I'm with
philwinkel
If I want to put a resource (image, music, text) it should be uploaded as the content-type I'm putting in the request.
Because I'm not doing a multipart request, It's just one body with a resource like....
I forked the source and made some changes added a property to RestClient UploadRaw and it just skips the lines commented by philwinkel
the method look like this
private void WriteMultipartFormData(Stream requestStream)
{
if (!UploadRaw)
{
foreach (var param in Parameters)
{
WriteStringTo(requestStream, GetMultipartFormData(param));
}
}
foreach (var file in Files)
{
// Add just the first part of this param, since we will write the file data directly to the Stream
if (!UploadRaw)
WriteStringTo(requestStream, GetMultipartFileHeader(file));
// Write the file data directly to the Stream, rather than serializing it to a string.
file.Writer(requestStream);
WriteStringTo(requestStream, _lineBreak);
}
if (!UploadRaw)
WriteStringTo(requestStream, GetMultipartFooter());
}
Just need to change the header content-type because it seems it's adding multipart/form-data
Anyways just finish like soon, hope tomorrow, and I'll make a pull request....
Thanks for RestSharp