Skip to content

[wasm][HTTP] TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body #53591

@pavelsavara

Description

@pavelsavara

This is behavior of underlying browser network component which makes sense. The open question is if we want to wrap the exception message.

Details

Failing tests System.Net.Http.Functional.Tests.HttpClientHandler_RemoteServerTest when executed on Wasm/Browser in Outerloop tests.

Methods

  • SendAsync_SendRequestUsingMethodToEchoServerWithContent_Success
  • SendAsync_SendRequestUsingNoBodyMethodToEchoServerWithContent_NoBodySent

Fails with

System.Net.Http.HttpRequestException : TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
   at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at System.Net.Http.Functional.Tests.HttpClientHandler_RemoteServerTest.SendAsync_SendRequestUsingMethodToEchoServerWithContent_Success(String method, Uri serverUri)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions