0 votes

Hi all,
I wanna use the HTTPRequest node to make an online API call.
I set up the URL in a variable (say req), called $HTTP.request(req) and got this error (Malformed URL).
I double checked the URL syntax on the API docs and it is correct, I'm particularly sure because I printed out the URL generated in Godot, pasted it on my browser and the online API responded with no errors.
I've been looking around the Godot docs but I haven't found anything useful.
Any clues?

in Engine by (570 points)
edited by

1 Answer

0 votes
Best answer

The error was pretty simple to fix: I just needed to add "http://" at the start of the URL string, even though it was not necessary for the API request.
Although I still have problems, I tried printing the HTTP response code and it is 200 (OK), so the request is accepted.

by (570 points)
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 Frequently asked questions and 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 [email protected] with your username.