-
Notifications
You must be signed in to change notification settings - Fork 47
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 POST? #4
Comments
This has been added to AFMotion 0.3 (just released). The syntax looks like this: https://github.com/clayallsopp/afmotion#multipart-requests It leaks the AFNetworking abstraction a bit, but it at least exposes a somewhat cleaner interface...would've been a bigger undertaking/hack to get it working with an ideal implementation =\ |
Ah, perfect! How ca I monitor and display progress with the solution? I want to use a progressbar like I do with raw AFNetworking solution. |
I added a new API for this, update to AFMotion version 0.4: client.multipart.post("avatars") do |result, form_data, progress|
if form_data
# Called before request runs
# see: https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ
form_data.appendPartWithFileData(data, name: "avatar", fileName:"avatar.png", mimeType: "image/png")
elsif progress
# 0.0 <= progress <= 1.0
my_widget.update_progress(progress)
elsif result.success?
...
else
...
end
end |
Hello,
I am trying to upload an image to my remote Rails API (with paperclip).
How can I do a multipart POST using Afmotion?
Thanks!
The text was updated successfully, but these errors were encountered: