question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Call failed. Cannot send a content-body with this verb-type. Simple Post-Redirect-Get

See original GitHub issue

The docs are lacking in this scenario, expected it to work like browsers, that is according to RFC i guess, this is how my current httpwebrequest was working.

Im doing a simple POST that gets a redirect, i was normally getting the target url source at the end, but it is not working with Flurl.

Sample code representing my use case, httpbingo is an online website so u can test clients

var src = "http://httpbingo.org/redirect-to?url=http%3A%2F%2Fexample.com%2F".PostUrlEncodedAsync("test=test").Result;

This returns the error: Call failed. Cannot send a content-body with this verb-type. GET http://example.com/

Im expecting it to follow any redirect there is and return the target website src. If i disable auto redirect it works but ofc there is no target src then.

It looks like Flurl for some reason cannot do a PRG so i can obtain the src of the redirect target with just one call. Is this a bug or im missing something here?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewproscommented, Dec 20, 2020

Well i’m terribly sorry if i sounded bad, it was not my intention at all, i just wanted the library to be complete and working in all scenarios as it is really good. I know why the redirect features are there and i think they are great, very handy. The workaround for now is to use that features and disabling redirect when expecting it after POST and do the follow up manually with the lib or not if the resulting data is not needed. The important thing is the bug is identified and will be fixed, that’s all we need.

0reactions
tmeniercommented, May 4, 2021

Published to NuGet in Flurl.Http 3.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot send a content-body with this verb-type
Method = "GET"; using (WebResponse response = request.GetResponse()) { using (Stream stream = response.GetResponseStream()) { XmlTextReader ...
Read more >
PowerShell API Call: Cannot Send a Content-Body with ...
Specifically, it asks for a key/value pair for the path of the directory that you are looking to retrieve in the API response....
Read more >
Error: Cannot send a content-body with this verb-type
Hello, I've recently upgraded my VS project from VS2017 to VS2019. Also I've upgraded the dotnet framework version from 4.7.2 to 4.8.
Read more >
Cannot send a content-body with this verb-type – BizTalk Error
This error is generated by BizTalk when you try to send content body in message for GET verb type REST API call. In...
Read more >
Cannot send a content-body with this verb-type using PCo- ...
The issue is that I keep having this error while trying to test the call: "Cannot send a content-body with this verb-type".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found