Bug in RestSharp: Crashes when posting large parameters

157 views
Skip to first unread message

Tim Kremer

unread,
Nov 28, 2012, 6:45:51 PM11/28/12
to rest...@googlegroups.com
Hi folks,
 
Just found an issue where RestSharp crashes whenever you do a POST request where any of the posted parameters are large.
I my case I was trying to post an html email to MailGun's API.
 
The reason is that each posted parameter is being URL encoded using Uri.EscapeDataString() in RestSharp > Extensions > StringExtensions.cs  (https://github.com/restsharp/RestSharp/blame/master/RestSharp/Extensions/StringExtensions.cs)
 
It's throwing a 'Url string is too long' exception. I believe the limit of this .net function is 32k..
 
I'm not very familiar with protocol for bug reports in open source projects, but hoping someone on the team will find this useful & be able to resolve it. (Maybe by breaking up the string into smaller blocks for encoding.)
 
Thanks
 
Tim
 

Andrew Young

unread,
Nov 28, 2012, 6:59:05 PM11/28/12
to rest...@googlegroups.com
Sounds just like this bug but for POSTs.


Andrew Young

--
Sent with Sparrow

Nicholas Head

unread,
Dec 5, 2012, 3:29:50 PM12/5/12
to rest...@googlegroups.com
Tim,

I'm experiencing the same issue with Mailgun and RestSharp. I've commented on the pull request and made MailGun aware of the issue in their code example. We'll see how this pans out.

Steven Burman

unread,
May 22, 2013, 12:36:30 AM5/22/13
to rest...@googlegroups.com
Did anything end up happening with this issue? It has been around for a while and I have seen a few different workarounds. Did anything get pulled into the product?

I would love to stay on the Nuget path for this dependancy and avoid custom builds if possible.
Reply all
Reply to author
Forward
0 new messages