You should use something like that:
func _ready():
var xhr = HTTPRequest.new();
xhr.connect("request_completed", self, "OnRequestCompleted");
var body = {"num": 5}
var status = xhr.request("127.0.0.1/numfile", [], true, HTTPClient.METHOD_POST, body)
if status != OK:
push_error("Something went wrong :(")
func OnRequestCompleted(result, response_code, headers, body):
print(body.get_string_from_utf8())
You need to create a num_file in your server and write it, for example, in PHP.
I hope this will be useful for you.
MxtApps :)