Skip to content

Push database to server by code #3537

Answered by justinclift
CacaceNicolas asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, in your $HTTPRequest.request() call, is there a way to convert body to a string directly rather than use to_json()?


Looking at the Godot 3.x docs, it looks like there's a function called get_string_from_utf8() which might be what's needed instead:

https://docs.godotengine.org/en/3.0/classes/class_poolbytearray.html#class-poolbytearray-get-string-from-utf8

So, that'd make it something like this:

$HTTPRequest.request(url, headers, true, HTTPClient.METHOD_POST, body.get_string_from_utf8())

Replies: 2 comments 36 replies

Comment options

You must be logged in to vote
34 replies
@justinclift
Comment options

@CacaceNicolas
Comment options

@justinclift
Comment options

@justinclift
Comment options

Answer selected by CacaceNicolas
@justinclift
Comment options

@CacaceNicolas
Comment options

@justinclift
Comment options

@CacaceNicolas
Comment options

Comment options

You must be logged in to vote
2 replies
@justinclift
Comment options

@justinclift
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants