Skip to content

Instantly share code, notes, and snippets.

@berikv
Created July 2, 2012 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berikv/3032992 to your computer and use it in GitHub Desktop.
Save berikv/3032992 to your computer and use it in GitHub Desktop.
My tools for webservice debugging
# First install LWP
sudo cpan install LWP
# Then add some aliasses, add them to your shell's startup script
lwpOptions="-uUsSe"
alias GET="lwp-request -m GET $lwpOptions"
alias POST="lwp-request -m POST $lwpOptions"
alias HEAD="lwp-request -m HEAD $lwpOptions"
# Now use them:
#[user@host ~]$ GET localhost
#GET http://localhost
#User-Agent: lwp-request/5.834 libwww-perl/6.04
#
#GET http://localhost --> 200 OK
#Connection: close
#Date: Mon, 02 Jul 2012 12:25:35 GMT
#Accept-Ranges: bytes
#ETag: "a99f48-2c-4bab70a36fd00"
#Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.10 with Suhosin-Patch
#Vary: negotiate
#Content-Language: en
#Content-Length: 44
#Content-Location: index.html.en
#Content-Type: text/html
#Last-Modified: Thu, 08 Mar 2012 08:27:00 GMT
#Client-Date: Mon, 02 Jul 2012 12:25:35 GMT
#Client-Peer: 127.0.0.1:80
#Client-Response-Num: 1
#TCN: choice
#
#<html><body><h1>It works!</h1></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment