FunnyGames
Member
Hello,
I'm trying to send a GET request with http_request, but it sends a POST.
I've wrote this in create:
And this in Async - HTTP:
The response comes as "404 - cannot POST".
I've tried with Postman and I got the same result if I used POST method. (Using GET in postman works as should)
For some reason the http_request not accepting GET and converts it to POST.
I've noticed that this problem occurs also with DELETE. It sends a POST method.
Only POST/PUT/PATCH works.
I've managed to get result from the server using http_get. But this function misses headers. And I would prefer to use http_request.
I believe this is a bug?
Any help would be appreciated. Thank you in advance!
I'm trying to send a GET request with http_request, but it sends a POST.
I've wrote this in create:
Code:
var url, headers, data;
url = "http://localhost:3000/";
headers = ds_map_create();
data = ds_map_create();
req = http_request(url, "GET", headers, json_encode(data));
ds_map_destroy(headers);
ds_map_destroy(data);
Code:
show_debug_message("async call");
show_debug_message(ds_map_find_value(async_load, "id"));
if (ds_map_find_value(async_load, "id") == req) {
var status = ds_map_find_value(async_load, "status");
show_debug_message(status);
if (status == 0) {
show_debug_message(ds_map_find_value(async_load, "http_status"));
var result = ds_map_find_value(async_load, "result");
show_debug_message(result);
}
}
I've tried with Postman and I got the same result if I used POST method. (Using GET in postman works as should)
For some reason the http_request not accepting GET and converts it to POST.
I've noticed that this problem occurs also with DELETE. It sends a POST method.
Only POST/PUT/PATCH works.
I've managed to get result from the server using http_get. But this function misses headers. And I would prefer to use http_request.
I believe this is a bug?
Any help would be appreciated. Thank you in advance!