我有一个原始HTTP流量文件,格式如下:
---------------------- dataset.txt ---------------------------------- GET http://localhost:8080/tienda1/index.jsp HTTP/1.1 User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.8 (like Gecko) Pragma: no-cache Cache-control: no-cache Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: x-gzip, x-deflate, gzip, deflate Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 Accept-Language: en Host: localhost:8080 Cookie: JSESSIONID=1F767F17239C9B670A39E9B10C3825F4 Connection: close POST http://localhost:8080/tienda1/publico/anadir.jsp HTTP/1.1 User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.8 (like Gecko) Pragma: no-cache Cache-control: no-cache Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Encoding: x-gzip, x-deflate, gzip, deflate Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5 Accept-Language: en Host: localhost:8080 Cookie: JSESSIONID=933185092E0B668B90676E0A2B0767AF Content-Type: application/x-www-form-urlencoded Connection: close Content-Length: 68 id=3&nombre=Vino+Rioja&precio=100&cantidad=55&B1=A%F1adir+al+carrito ... ...
是否有任何实用程序可以读取此文件并提交到我的本地Web服务器?
答案 0 :(得分:0)
这里有两个请求。 首先是GET,第二是POST。
如果您使用上述格式,您可以编写简单的程序(按顺序)
在python-requests中解决问题是完美的。解析可以在python basic lib中完成。