Emanuel
unread,Mar 5, 2012, 3:28:44 PM3/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RestSharp
I am using FileParameter to send a byte array. so I send it using
empty file name (otherwise it doesn't work)
request.AddFile("stream", byteArray, false, string.Empty);
When I receive the byte array on server side I treat it like this:
Encoding.UTF8.GetBytes((string)Request.Form.stream)
The array I get in result is perfect except for 2 bytes, the last
ones, there is a carriage return and a new line.
It seams that for multipart forms RestSharp adds a footer.
I found this In Http.cs (Line 208)
private static string GetMultipartFooter ()
{
return string.Format ("--{0}--{1}", FormBoundary, _lineBreak);
}
So every time I send a byte array RestSharp addes a carriage return
and a new line (bytes: 13,10).
Why add a those 2 bytes to the footer for multipart-forms, is there
something I do not understand / am I using it wrong / is this a bug?