restsharp.portable icon indicating copy to clipboard operation
restsharp.portable copied to clipboard

GetOrPost parameters added to the URL query for a PUT request

Open tcorrin opened this issue 8 years ago • 4 comments

Get Or Post parameters are added as x-www-form-urlencoded for a POST request or in the URL query for a GET request however for a PUT request they are added using both methods. The x-www-form-urlencoded check is != GET and the query string check is != POST.

tcorrin avatar Jun 21 '17 15:06 tcorrin

This appears to be:

https://github.com/VQComms/restsharp.portable/blob/master/src/FubarCoder.RestSharp.Portable.HttpClient/RestClientExtensions.cs#L88 = != GET add params to body

https://github.com/FubarDevelopment/restsharp.portable/blob/6811f9290f83d243a1cbc976843e2ba473015fa1/src/FubarCoder.RestSharp.Portable.Core/RestClientExtensions.cs#L163 != POST add param to querystring

As @tcorrin says, both should be != GET

jchannon avatar Jun 21 '17 17:06 jchannon

Are you sure that this should be != GET? This condition determines the parameters to be added to the query string and the != POST ensures that GetOrPost parameters are added to the query string for all non-POST requests.

fubar-coder avatar Jun 22 '17 15:06 fubar-coder

It should be != POST && != PUT I think

On 22 June 2017 at 16:42, Mark Junker [email protected] wrote:

Are you sure that this should be != GET? This condition determines the parameters added to the query string and the != POST ensures that GetOrPost parameters are added to the query string for all non-POST requests.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FubarDevelopment/restsharp.portable/issues/98#issuecomment-310419523, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGapsFmr4gusR0Mdwx78mLszl3fGpKeks5sGot_gaJpZM4OBGtk .

jchannon avatar Jun 22 '17 15:06 jchannon

Yes, this causes huge issues when I attempt to send a file through a put.

HappyTreesDev avatar Jul 07 '17 17:07 HappyTreesDev