Hi,
I am using a RESTful web service where I would like to add data from our unreal game client.
I have read the official documentation and some other threads on how to send those requests to a server(Get Http Module to work with HTTPS How to Make Http GET request in C++), am still not sure if the order of instructions matters, please let me know if what I am using look correct
TSharedRef<IHttpRequest> Request = HttpModule->CreateRequest();
Request->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
Request->SetURL("https://user:pass@mysite.com:445");
Request->SetVerb("GET");
Request->OnProcessRequestComplete().BindUObject(this, &AMyGameMode::OnResponseReceived);
Request->ProcessRequest();
I get an OK response from the server when executing the above, apparently the authentication is correct.
The problem arises when I start using any content in the request (either SetContentAsString, even from a file stream),
you can read the full log in the log.txt file attachedlog error when requesting with content, sufficient to say
that the server returns libcurl error: 52 (Server returned nothing (no headers, no data))
Even with the simplest body it return the same error, same with POST verbs, the ones I am interested in .
GET myndex/_search
{
}
Which translates into C++ code like
FString content("myindex/_search {}");
Request->SetContentAsString(content);
Even if the content is stored in a json file and passed as I get the same error, which verifies that my json format is correct.
Request->SetContentAsStreamedFile(myJsonFile);
Is there anything else left on my side, or would this be related to the server I am using?
Appreciate any help.
Regards