How do I perform get and post requests from Gdscript in Godot? I am trying to get a map API and use it in the game.


1 Answer 1


As someone else said, check out the HTTPClient class.

It's nonblocking, so you'll need to check for when it's finished.

A barebones example with no error checking would be the following:

var http = HTTPClient.new()
var headers=[
    "User-Agent: Pirulo/1.0 (Godot)",
    "Accept: */*"
if (http.has_response()):
    #read through the chunks...

Really, this is just pseudo-code. The docs have a really complete code example. http://docs.godotengine.org/en/latest/tutorials/http_client_class.html


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .