0

I am trying to get a batch script which will do the below task.

  1. Telnet to any website on port 80 (telnet google.com 80)
  2. Execute HTTP GET request (GET / HTTP/1.1 and host: google.com)
  3. Redirect this output to the txt file.

I want the output in .txt files as shown below.

Filename: HTTP.txt

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.co.in/?gfe_rd=cr&ei=ClUXV8WSEujI8Aep2L7oAQ
Content-Length: 261
Date: Wed, 20 Apr 2016 10:08:10 GMT

I want a batch file to auto input HTTP GET request and to set the HTTP host as well.

manjesh23
  • 369
  • 1
  • 4
  • 21

1 Answers1

0

For http reques you can try winhttpjs.bat :

call winhttpjs.bat "http://google.com"  -method GET -reportfile reportfile.txt

though the format of the report is not exactly what you want you can rewrite it to fit your needs.

npocmaka
  • 55,367
  • 18
  • 148
  • 187