Skip to content

Commit

Permalink
Fix content-length issue for get requests. Close #354. Close #99.
Browse files Browse the repository at this point in the history
(cherry picked from commit acbad67)
  • Loading branch information
ufna committed Aug 26, 2021
1 parent 4ba5c8c commit bf26e85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/VaRest/Private/VaRestRequestJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ void UVaRestRequestJSON::ProcessRequest()
{
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json"));

// Body is ignored for get requests, so we shouldn't place json into it even if it's empty
if(RequestVerb == EVaRestRequestVerb::GET)
{
break;
}

// Serialize data to json string
FString OutputString;
TSharedRef<TJsonWriter<>> Writer = TJsonWriterFactory<>::Create(&OutputString);
Expand Down

0 comments on commit bf26e85

Please sign in to comment.