How to send data to http request via post method?

TSharedRef<IHttpRequest, ESPMode::ThreadSafe> Request = Http->CreateRequest();
FString JsonString = “{"name":"john", "age":22, "class":"mca"}”;

Request->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
Request->SetURL("http://localhost/api.php");
Request->SetVerb("POST");

Request->SetContentAsString(JsonString);
Request->OnProcessRequestComplete().BindUObject(this, &UAuthWidget::OnResponseReceived);
Request->ProcessRequest();

When submitting to server api in $_POST is empty.
If you remove the application/json of header, then this line comes to $_POST, of course it is not valid…

Why is there so little information about working with api?

Try adding these headers to your request and see if it works:

Request->SetHeader(TEXT("User-Agent"), TEXT("X-UnrealEngine-Agent"));
Request->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
Request->SetHeader(TEXT("Accepts"), TEXT("application/json"));
Request->SetHeader(TEXT("Accept-Encoding"), TEXT("identity"));