restsharp / restsharp/RestSharp
TypeError: Failed to execute 'fetch' in Blazor Webassembly
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.8k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
I am using the code below
var options = new RestClientOptions("http://apibihml.value4u.com.br");
var client = new RestClient(options);
var request = new RestRequest("/obter-acesso/", Method.Get);
request.AddHeader("Host", "apibihml.value4u.com.br");
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.AddHeader("AcceptCharset", "utf-8");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Erro in blazor
▶ | ErrorMessage | 'TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.' |
- OS: Windows
- .NET version 8
- Blazor Webassembly
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the request in a .NET 8 Blazor WebAssembly app using the shown RestClientOptions, RestRequest, and ExecuteAsync call; inspect the generated browser fetch request and the reported error output. Done means the GET request no longer triggers the reported fetch error and its response can be read.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100