posting HTTP request from mobile

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By marcorexo


I want to send some data from a mobile to my server (running on a PC). Testing the Godot app on the PC successfully sends the data to my webserver. However, running the same app from an Android mobile device does not work (no data received on the webserver). What’s different about sending the data via a post http request from a mobile? how can I do this? Thank you!

Here’s my code:

extends Node2D

onready var data = "testing ...."
onready var url  = "http://my_url:8001"

func _ready():
	var query = JSON.print(data)
	# Add 'Content-Type' header:
	var headers = ["Content-Type: application/json"]
	$HTTPRequest.request(url, headers, false, HTTPClient.METHOD_POST, query)
:bust_in_silhouette: Reply From: volzhs

you need to enable Internet permission at export setting.

Thanks volzhs!!

marcorexo | 2019-05-30 09:08