Problem connecting to a url with http request node.

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

request("https://" + username + ":" + password + "@api.twilio.com/2010-04-01/Accounts/" + username + "/Messages.json")

The above code in the HTTP request node gives me the following error:
1)
E 0:00:03.909 to_int: Cannot represent (password)@api.twilio.com as integer, provided value is too big.
<C++ Error> Condition “integer > 2147483647 / 10” is true. Returned: sign == 1 ? 2147483647 : (-2147483647 - 1)
<C++ Source> core/ustring.cpp:1792 @ to_int()
HTTPRequest.gd:20 @ _on_Button_pressed()
2)
E 0:00:03.912 _parse_url: Condition “port < 1 || port > 65535” is true. Returned: ERR_INVALID_PARAMETER
<C++ Source> scene/main/http_request.cpp:81 @ _parse_url()
HTTPRequest.gd:20 @ _on_Button_pressed()

Ive removed the username and password part and it successfully connected to the API,but it says I did not do authentication,so I used post method to pass in the authentication with the header as follow:

["username:password"]

but it still does not work…It says the same thing…
Can anyone please explain how do I connect to twilio REST API with Godot with authentication???

God Of Theory | 2020-04-15 01:33

:bust_in_silhouette: Reply From: RBdev

put it in a String varlike so ###### var uri = str("“https://“,username,”:“,password,”@api.twilio.com/2010-04-01/Accounts/“,username,”/Messages.json”) this should work username and password are youre variables. happy holidays :slight_smile: