Call failed. Cannot send a content-body with this verb-type. Simple Post-Redirect-Get
See original GitHub issueThe 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:
- Created 3 years ago
- Comments:13 (7 by maintainers)
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.
Published to NuGet in Flurl.Http 3.1.0