Closed jchannon closed 8 years ago
You have to use GetOrPost as parameter type.
And you have to use POST. Using PUT does seem unusual for form-url-encoded
Ah I've spotted it. Using GetOrPost on a PUT it doesn't add the ContentType header
Using PUT and RequestBody it defaults to application/json
Seems that it should add the header of application/x-www-form-urlencoded
like it does for POST when using PUT when using GetOrPost
It's some kind of tough. application/x-www-form-urlencoded
is very unusual for PUT
requests, because those are usually for storing data (see What's the difference between a POST and a PUT HTTP REQUEST?). I agree, that there should be a way to support application/x-www-form-urlencoded
together with PUT
. Please let me validate some things first.
Ok thanks.
I'll check with a colleague but I think they are using PUT on a 3rd party API that has this requirement.
If it helps Restsharp seems to work. They spotted it when it didn't work the same with Portable
On Friday, 20 May 2016, Mark Junker notifications@github.com wrote:
It's some kind of tough. application/x-www-form-urlencoded is very unusual for PUT requests, because those are usually for storing data (see What's the difference between a POST and a PUT HTTP REQUEST? http://stackoverflow.com/questions/107390/whats-the-difference-between-a-post-and-a-put-http-request). I agree, that there should be a way to support application/x-www-form-urlencoded together with PUT. Please let me validate some things first.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/FubarDevelopment/restsharp.portable/issues/69#issuecomment-220703253
I released a new alpha version. Please close this issue when the request works as expected.
Where can I see it?
On 20 May 2016 at 22:32, Mark Junker notifications@github.com wrote:
I released a new alpha version. Please close this issue when the request works as expected.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/FubarDevelopment/restsharp.portable/issues/69#issuecomment-220723669
You can find the nuget feed on the myget gallery page: https://www.myget.org/gallery/restsharp-portable
Thanks
On Saturday, 21 May 2016, Mark Junker notifications@github.com wrote:
You can find the nuget feed on the myget gallery page: https://www.myget.org/gallery/restsharp-portable
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/FubarDevelopment/restsharp.portable/issues/69#issuecomment-220767358
I get an error when adding it 'FubarCoder.RestSharp.Portable.Core' already has a dependency defined for 'NETStandard.Library'.
On 21 May 2016 at 10:25, Jonathan Channon jonathan.channon@gmail.com wrote:
Thanks
On Saturday, 21 May 2016, Mark Junker notifications@github.com wrote:
You can find the nuget feed on the myget gallery page: https://www.myget.org/gallery/restsharp-portable
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/FubarDevelopment/restsharp.portable/issues/69#issuecomment-220767358
It's a known problem. You have to use NuGet 3.5 beta (also for Visual Studio 2015 as VSIX). You can download it from https://dot.net download section
Updated but now it doesn't compile:
Is there a DLL naming issue? The packages.config says FubarCoder.RestSharp.Portable.Core
but the References says RestSharp.Portable.Core
For HTTPClient they say both the same prefixed with FubarCoder
This works here. It seems that you forgot a dotnet restore
(when using .NET Core), or maybe nuget didn't add the FubarCoder.RestSharp.Portable.Core
to your project and/or packages.config
.
Example application (using both .NET Core and .NET Framework 4.6.1) TestRestSharpPortableCore.zip
Looks like nuget messed it up, re-added the reference and now works as expected with PUT and GetOrPost
Hi,
We've spotted something odd when using the below code:
In the screenshot you'll see that the form looks like "john=john" and the raw body is "john".
Using Postman the Form and Body is "name=john" as expected