Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Raheel |
I’m making an HTTPRequest to an API and getting back a response. I get the correct response body in the callback function, but I don’t get all the headers the API is sending. When I try making the same request using Postman, I get all the headers I’m supposed to get.
Following is the code snippet I’m using:
Get(string endpoint, Object callbackTarget, string callbackMethod, string name, Godot.Collections.Array binds, List<string> headers, int timeOutDuration)
{
var request = new HTTPRequest { Name = name, Timeout = timeOutDuration};
AddChild(request);
request.Connect("request_completed", callbackTarget, callbackMethod, binds);
var error = request.RequestRaw(url, headers, true, HTTPClient.Method.Get);
}
Probably helpful to post your request_completed
handler. One of its parameters contains the headers.
spaceyjase | 2023-04-11 14:31