summaryrefslogtreecommitdiff
path: root/scene/main/http_request.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/http_request.cpp')
-rw-r--r--scene/main/http_request.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index f3c7d128ba..775dfa4c46 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -322,7 +322,8 @@ bool HTTPRequest::_update_connection() {
} else {
// Did not request yet, do request
- Error err = client->request_raw(method, request_string, headers, request_data);
+ int size = request_data.size();
+ Error err = client->request(method, request_string, headers, size > 0 ? request_data.ptr() : nullptr, size);
if (err != OK) {
call_deferred("_request_done", RESULT_CONNECTION_ERROR, 0, PackedStringArray(), PackedByteArray());
return true;
@@ -627,7 +628,7 @@ void HTTPRequest::_bind_methods() {
}
HTTPRequest::HTTPRequest() {
- client.instantiate();
+ client = Ref<HTTPClient>(HTTPClient::create());
timer = memnew(Timer);
timer->set_one_shot(true);
timer->connect("timeout", callable_mp(this, &HTTPRequest::_timeout));