-
Notifications
You must be signed in to change notification settings - Fork 341
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
multipart upload #47
Comments
You should be able to do something like:
HTTPoison will support exactly what hackney accepts as possible request body: https://github.com/benoitc/hackney#send-a-body |
Thanks a ton! are you aware of a way to change the Content-Disposition name from "file" to "content", do I need to set Disposition in extraheaders or something? |
btw, i've tried this, but the extraheaders don't override options = {:multipart,[
{:file, filename,[{"filename",filename},{"Content-Type","image/jpeg"},{"name","content"}]}
]} this creates the following
I need name=file to be name=content, but i'm not sure how to get that form element set correctly in conjunction with :file |
ok, i've been able to get the request the way I want it via hackney directly, but the amazon cloud drive api isn't liking the request url = "http://localhost:9010/foo"
filename = "test.txt"
header = ["Authorization": "Bearer #{@at}"]
options = {:multipart, [
{:file, filename, {"form-data",
[{"name", "content"}, {"filename", filename}]},
[{"Content-Type", "image/jpeg"}]
},
{"metadata", ~s({"name":#{filename},"kind":"FILE"})}
]}
res = :hackney.post(url, header, options) |
I wonder if you are hitting this issue: benoitc/hackney#171 |
This was an issue with the api endpoint I was using. closing the issue. |
Oh! Great! I will probably add a test to have an "example" there for multipart upload. |
Done by af3931f |
any plans to support multipart upload? Is this possilbe today, or do you need to use hackney_multipart somehow?
The text was updated successfully, but these errors were encountered: