Skip to content
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

How do I post multipart/form-data #97

Open
Dani4kor opened this issue Mar 15, 2021 · 3 comments
Open

How do I post multipart/form-data #97

Dani4kor opened this issue Mar 15, 2021 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@Dani4kor
Copy link

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

@nakabonne
Copy link
Owner

@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"

@Dani4kor
Copy link
Author

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

@nakabonne
Copy link
Owner

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

@nakabonne nakabonne added the help wanted Extra attention is needed label Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants