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

POST requests : file upload (multipart/form-data) #31

Closed
rsertelon opened this issue Jul 18, 2011 · 2 comments
Closed

POST requests : file upload (multipart/form-data) #31

rsertelon opened this issue Jul 18, 2011 · 2 comments
Milestone

Comments

@rsertelon
Copy link
Contributor

Allow users to send files via POST requests using AHC zero copy capability => available

We want to simulate a form with file upload.

@rsertelon
Copy link
Contributor Author

No idea how to build a request with multipart/form-data.

I asked on AHC mailing list if there were any resources, still waiting...

https://groups.google.com/forum/#!topic/asynchttpclient/sXqZbibN58I

@ghost ghost assigned rsertelon Dec 6, 2011
@slandelle
Copy link
Member

It seems to be quite with AHC easy actually :
new RequestBuilder()
...
.addHeader("Content-Type", "multipart/form-data")
.addBodyPart(new StringPart("foo", "bar"))
.addBodyPart(new StringPart("baz", "qux"))
.addBodyPart(new com.ning.http.client.FilePart(new File("a_file").name, new File("a_file"), "text/plain", "UTF-8"))

@rsertelon rsertelon removed their assignment Jul 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants