Upload attachment - POST, C#, RestSharp
I'm developing a C# app that uses Redmine REST API, it uses RestSharp Client for JSON calls. All other REST calls I make work fine but I cannot find a way to upload attachments. I've widely searched the web and tried many solutions but nothing worked.
The code actually looks like: http://pastebin.com/3Q8SLnwg
If I execute it above nothing happens and the response is empty with error "Not Acceptable". If I remove line 8 (the AddBody), it actually works but of course nothing is uploaded, JSON response:
So actually, the real question is what to punt in AddBody() to send the file as application/octet-stream. Since RestSharp also has a request.AddFile() method, I tried it too in different ways but nothing...
Any help much appreciated!
RE: Upload attachment - POST, C#, RestSharp - Added by Jan Niggemann (redmine.org team member) about 4 years ago
Moved to Development...