How to chang the port 3030
My dart need to call server in address [localhost]:8888/demo/json_servlet.
But under testing mode default use http://[localhost]:3030/
Can I change the port from 3030 to 8888?
// Request some JSON from the server.
// to parse it.
HttpRequest.getString("/demo/json_servlet").then((jsonStr) {
printString("Here's the JSON I got: $jsonStr");
}).catchError((e) {
printString("Couldn't fetch JSON: ${e.error}");
});
Because I don't want to hard code the remote address like
HttpRequest.getString("http://[localhost]:8888/demo/json_servlet")
No comments:
Post a Comment