nakabonne/ali

How do I post multipart/form-data

Dani4kor opened this issue · 3 comments

Hello there

I got this curl command which post some form-data

curl -iL -X POST "http://127.0.0.1:4001/get_sep_data/" -H "accept: application/json" -H "Authorization: Bearer XXXXXXXX" -H "Content-Type: multipart/form-data" -F "url_1=https://i.ytimg.com/vi/-TnUwv9i-4g/maxresdefault.jpg"

How do I do this with Ali?

Thank you

@Dani4kor Hi. Could you try out it and let me know if this works as you expected?

ali -m POST -H "accept: application/json" -H "Authorization: Bearer XXXXXXXX" -H "Content-Type: multipart/form-data; boundary=aBoundaryString" --body-file body.txt

body.txt

--aBoundaryString
Content-Disposition: form-data; url_1="https://i.ytimg.com/vi/-TnUwv9i-4g/maxresdefault.jpg"

thank you for advice, but its not helped :(

got this error "Did not find CR at end of boundary (17)" on server error

also I tried to change body.txt with

--aBoundaryString
Content-Disposition: form-data; name="url_1"

https://i.ytimg.com/vi/-TnUwv9i-4g/maxresdefault.jpg
--aBoundaryString--

and other variations, but nothing
still not work

Curl command still work

@Dani4kor Sorry for the delay. Apparently, seems like we need extra support for it.