curlconverter / curlconverter

Transpile curl commands into Python, JavaScript and 27 other languages
https://curlconverter.com
MIT License
7.18k stars 871 forks source link

curl "http://p.3.cn/prices/mgets?callback=jQuery1377247^&type=1^&area=1_72_4137_0^&skuIds=J_7437788^%^2CJ_100000177756^%^2CJ_5821455^&pdbp=0^&pdtk=^&pdpin=^&pduid=^&source=list_pc_front^&_=1542186498283" -H "Accept: */*" -H "Connection: keep-alive" -H "Accept-Encoding: gzip, deflate" -H "Referer: http://list.jd.com/list.html?cat=9987,653,655" -H "Accept-Language: zh-CN,zh;q=0.9" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" --compressed #107

Closed Zhangfredy closed 3 years ago

Zhangfredy commented 5 years ago

Incorrect operation

cf512 commented 4 years ago

I looked into this and the Error parsing curl command seems to be because of escaping characters in the p.3.cn URI. Console errors were logged as: "URIError: URI malformed".

When I removed the ^'s manually, it then converted successfully.

Updated Input:

curl -H "Accept: */*" -H "Connection: keep-alive" -H "Accept-Encoding: gzip, deflate" -H "Referer: http://list.jd.com/list.html?cat=9987,653,655" -H "Accept-Language: zh-CN,zh;q=0.9" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" "http://p.3.cn/prices/mgets?callback=jQuery1377247&type=1&area=1_72_4137_0&skuIds=J_7437788%2CJ_100000177756%2CJ_5821455&pdbp=&pdtk=&pdpin=&pduid=&source=list_pc_front&_=1542186498283" --compressed

Can you confirm if your original input was from Windows curl cmd?

romadrutskii commented 3 years ago

PR #233 fixed the issue.

verhovsky commented 2 years ago

Duplicate of #143