Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't post a file as request body #583

Closed
hallem opened this issue Oct 15, 2014 · 4 comments
Closed

Can't post a file as request body #583

hallem opened this issue Oct 15, 2014 · 4 comments

Comments

@hallem
Copy link
Member

hallem commented Oct 15, 2014

The only way to post files to a rest endpoint is to use multi-part. Should be able send a single file as the body and the appropriate content type.

@dazinator
Copy link

Has this change been released yet? I am trying to post a single file at the moment but still seeing multi-part in the request so I am assuming not?

@hallem
Copy link
Member Author

hallem commented Nov 12, 2014

@dazinator It hasn't but there is a way to do it currently. Here is a link to a Gist that will show you how.
https://gist.github.com/hallem/5faaa6bebde50641e928

@hallem
Copy link
Member Author

hallem commented Jan 5, 2015

@TheKrush interesting. I've got it working exactly like that in an application I use. Can you show me a code sample so I can see what you're doing?

@TheKrush
Copy link

TheKrush commented Jan 6, 2015

@hallem Yeah I retract my previous statement, I was just informed our version of RestSharp was a year old, I updated it and all worked as expected.

edit: I deleted it to not cause confusion with others. You can delete this comment as well once you read if if you want to keep the solution simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants