-
Notifications
You must be signed in to change notification settings - Fork 984
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
Create PartParams class to allow multipart posts with JSON content and file upload at the same time #1017
Conversation
6f31ac4
to
0fca48f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jeremy-israel, thanks for addressing my PR comments. I'll try to not to throw it all away again ;)
This looks good, but I have a few suggestions below.
5135f40
to
718ec9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those changes. I think this PR is ready to go, but there are some follow up tasks:
- Rename
Faraday::UploadIO
toFaraday::FilePart
- Update documentation for making multipart posts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean and well structured 👍
Hey, after seeing the class name in the code and docs, I'm slightly bothered by the plural { raw: Faraday::ParamPart.new(some_json, "application/json") } I'm happy to make this quick change too if you don't want to bother :) |
3cfa12e
718ec9f
to
3cfa12e
Compare
…d IO content in the same request
3cfa12e
to
7dded89
Compare
Renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again. Merging this for real now 🤘
Description
This PR aims to make it possible to multipart POST an IO and a JSON payload at the same time.
Fixes #769
Opened after discussions in #1014
Additional Notes
Example of API which requires this :
https://developer.concur.com/api-reference/receipts/endpoints.html#endpoint-post-a-receipt
cURL data and image: