+1 vote


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)
in Engine by (92 points)

1 Answer

+6 votes
Best answer

you need to enable Internet permission at export setting.

by (9,742 points)
selected by

Thanks volzhs!!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.