Upload file as octet-stream using RestSharp 1.7

Viewed 394

I'm trying to upload a file as octet-stream with RestSharp 1.7 but can't get it to work.

I've tried the following approaches:

  • Using restRequest.AddFile("file", documentContent, MediaTypeNames.Application.Octet); This doesn't generate an octet-stream even if I specify it.

  • Using restRequest.AddBody(documentContent, MediaTypeNames.Application.Octet); This seems to generate an octet-stream but the content doesn't seem to be the correct byte content. This worked on v.1.6.

If anyone have a working version of uploading streaming file data for RestSharp v.1.7 it would be greatly appreciated.

1 Answers
Related