Http Post request with uri

Hi,

Can someone explain me how can I define in C++ the following requests for a RestFul API.

POST

POST my_index/_doc
{
    "name" : "Tom",
    "operation" : {
      "message" : "trying out Elasticsearch"
    }
}

GET

GET my_index/_search
{
  "query": {
    "match_all": {}
  }
}

It is not clear where the “my_index/_search” part is included (afaik, that’s the uri field).
If I add it to the content, I get no response from the server.

Should I include the uri as part of the or what’s the correct way?

This is the code I am using to create the requests, as you can read I don’t know how to define the “my_index/_search” section.

	TSharedRef<IHttpRequest> Request = Http->CreateRequest();
	Request->SetHeader(TEXT("Content-Type"), TEXT("application/"));
	Request->SetURL(TEXT("https://user:pass@mywebservice:443"));

	Request->SetVerb(TEXT("GET"));
        FString content(TEXT("{\"query\": {\"match_all\": {}}}"));
	Request->SetContentAsString(content);

	Request->OnProcessRequestComplete().BindUObject(this, &AKMGameMode::OnResponseReceived);
	Request->ProcessRequest();

Regards

When you input URI to browser or any other HTTP application it is divided in 2 parts, to server it needs to connect to and content it needs to request (or post) when connected. so if you input example.com/data/something, HTTP application will attempt to connect to example.com and then gonna send GET data/something request if it was successful.

So you should embed it to URL:

https://user:pass@mywebservice:443/my_index/_search

Thank you for your answer!
Is there official doc in the Unreal describing how to use this feature or is it something that is assumed to be known from web dev?

I tried connecting appending the data you mention above and I don’t get a server answer at all. I can send you a full log, but this is the first error reported

request failed, libcurl error: 52 (Server returned nothing (no headers, no data))

Also, tried using SetContentAsStreamedFile or SetContentAsString, getting the same results.
The file content is this one

{
 "query": {
    "match_all": {}
  }
}

Appreciate you help

EDIT: I think that in whatever form I add Content, that generates an error. Maybe am missing another step to send data?