No problem on Windows platform。But in the IOS platform Response.IsValid() is flase.Why?
void UBCHttpRequest::StartRequest(FString URL, FString JSONParams)
{
TSharedPtr<class IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
HttpRequest->OnProcessRequestComplete().BindUObject(this,&UBCHttpRequest::HandleHttpRequestComplete);
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/; charset=utf-8"));
HttpRequest->SetURL(URL);
HttpRequest->SetVerb(TEXT("POST"));
HttpRequest->SetContentAsString(JSONParams);
HttpRequest->ProcessRequest();
}
void UBCHttpRequest::HandleHttpRequestComplete(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
if (Response.IsValid() && EHttpResponseCodes::IsOk(Response->GetResponseCode()))
{
}
else
{
}
}