I am developing a module for a web application. To trigger this module, I need to submit some data to the server. For simple forms, Copy as cURL
in the Chrome Developer Tools works fine (using curl from msys[git]), but for post requests with multipart/form-data
, the copied string is neither usable in the windows shell (cmd) nor with bash (form msys); the copied text is similar to:
curl "http://myserver.local" -H "Origin: http://wiki.selfhtml.org" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryntXdlWbYXAVwCIMU" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "Cache-Control: max-age=0" -H "Referer: http://wiki.selfhtml.org/extensions/Selfhtml/frickl.php/Beispiel:HTML_form-Element1.html" -H "Connection: keep-alive" --data-binary "------WebKitFormBoundaryntXdlWbYXAVwCIMU"^ "Content-Disposition: form-data; name=""area"""^ "multi"^ "line"^ "------WebKitFormBoundaryntXdlWbYXAVwCIMU--"^ "" --compressed
Is there any way I could use this or convert it to something usable?
^
at the blank line? – Rob W^
this command is interpreted as one command (tried withcmd
andbash
). – Kleidersack