Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,10 @@ internal virtual void FillRequestStream(HttpRequestMessage request)
}
}

// Add the content headers
if (request.Content == null)
// Add the content headers except for Get Method per RFC7230
if ((request.Content == null)
&& !((IsStandardMethodSet() && (Method == WebRequestMethod.Default || Method == WebRequestMethod.Get))
|| (IsCustomMethodSet() && CustomMethod.ToUpperInvariant() == "GET")))
{
request.Content = new StringContent(string.Empty);
request.Content.Headers.Clear();
Expand Down