Hi Epic,
When I used custom VERB I have a crash in function FCurlHttpRequest::SetupRequest()
But when I changed this function I had right result
if (Verb == TEXT("POST"))
{
...
}
else if (Verb == TEXT("PUT"))
{
...
}
else if (Verb == TEXT("GET"))
{
...
}
else if (Verb == TEXT("HEAD"))
{
...
}
else if (Verb == TEXT("DELETE"))
{
...
}
// --> Inserted code
else if (!Verb.IsEmpty())
{
auto verb = StringCast<ANSICHAR>(*Verb); // We should pass an ANSI string as parameter
curl_easy_setopt(EasyHandle, CURLOPT_CUSTOMREQUEST, verb.Get());
// If we don't pass any other Content-Type, RequestPayload is assumed to be URL-encoded by this time
// (if we pass, don't check here and trust the request)
check(!GetHeader("Content-Type").IsEmpty() || IsURLEncoded(RequestPayload));
curl_easy_setopt(EasyHandle, CURLOPT_POSTFIELDS, RequestPayload.GetData());
curl_easy_setopt(EasyHandle, CURLOPT_POSTFIELDSIZE, RequestPayload.Num());
}
// <-- Inserted code
else
{
/* Removed line
UE_LOG(LogHttp, Fatal, TEXT("Unsupported verb '%s', can be perhaps added with CURLOPT_CUSTOMREQUEST"), *Verb);
*/
// Added line
UE_LOG(LogHttp, Fatal, TEXT("Empty verb is not supported, try to use one"));
FPlatformMisc::DebugBreak();
}
Can you fix it in further version of Unreal Engine?