2018-05-30 浏览器的开发者工具中观察XHR请求并右键拷贝为curl(bash)真的很好用!

比如其中一个ajax请求拷贝出来如下,然后bash下触发一次,比fiddler用起来快多了也方便多了。

curl 'http://localhost:19091/creativeMsg/addMaterialImage' -H 'Origin: http://192.168.1.161:8020' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryApcukEySAGWtDf0O' -H 'Accept: /' -H 'Referer: http://192.168.1.161:8020/template/edit/Creative_edit.html?Id=20' -H 'Connection: keep-alive' --data-binary $'------WebKitFormBoundaryApcukEySAGWtDf0O\r\nContent-Disposition: form-data; name="picData"\r\n\r\n{"creativeName":"test","creativeId":"40","materialType":"pic","validateRepeat":"1527587929902","tokenInfo":"31bf3911-4f2e-408b-a121-1ac97d2d6301"}\r\n------WebKitFormBoundaryApcukEySAGWtDf0O\r\nContent-Disposition: form-data; name="fileTest[]"\r\n\r\n\r\n------WebKitFormBoundaryApcukEySAGWtDf0O\r\nContent-Disposition: form-data; name="fileTest[]"; filename="test.PNG"\r\nContent-Type: image/png\r\n\r\n\r\n------WebKitFormBoundaryApcukEySAGWtDf0O--\r\n' --compressed

你可能感兴趣的:(2018-05-30 浏览器的开发者工具中观察XHR请求并右键拷贝为curl(bash)真的很好用!)