Trying to make curl -F
or form data work
#768
Unanswered
smokeyhallow
asked this question in
Q&A
Replies: 1 comment
-
Try with this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can anyone please help me implement the following
curl
command inHTTParty
?curl -X POST -F "image=@512x512.png" https://api.example.com/upload
I tried searching everywhere, but weirdly such an example doesn't even exist in examples list! I wonder how can that be? Is this feature not available in the gem?
This is one of the variations I tried:
HTTParty.post(URL, headers: headers, form_data: { image: File.read("512x512.png") })
Beta Was this translation helpful? Give feedback.
All reactions