Reputation: 41
I have a raw HTTP traffic file with following format :
---------------------- 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 ... ...
Is there any utility to read this file and submit to my local web server?
Upvotes: 0
Views: 128
Reputation: 1186
You have two requests here. First is GET, second is POST.
Provided that you are having such format as above, you could write simple program that will ( in order)
It would be perfect to solve the problem in python-requests. Parsing may be done in python basic lib.
Upvotes: 0