httpforge

httpforge creates or alters HTTP requests.

Options

Without any option, httpforge writes a GET request for the URI / with HTTP protocol version 1.0

> httpforge
GET / HTTP/1.0
-m METHOD, --method=METHOD
 

Set request method. The method may be any string. Try GET, POST, HEAD, OPTIONS and TRACE.

> httpforge -m HEAD
HEAD / HTTP/1.0
-u URI, --uri=URI
 

Set request URI.

> httpforge -u "/index.php"
GET /index.php HTTP/1.0
-a, --alter

Read a request from standard input and modify it.

> httpforge -m HEAD | httpforge -a -u "/index.php"
HEAD /index.php HTTP/1.0
-p VERSION, --protocol=VERSION
 

Set HTTP protocol version.

> httpforge -p 1.1
GET / HTTP/1.1
-s HEADER, --set-header=HEADER
 

Add or change a header. You can use this option several times.

> httpforge -s "Host: www.aspyct.org" -s "Accept: text/html"
GET / HTTP/1.0
Host: www.aspyct.org
Accept: text/html
-b BODY, --body=BODY
 

Set the body of the request. See also -l.

> httpforge -b "username=foo&password=bar"
GET / HTTP/1.0

username=foo&password=bar
-l, --content-length
 

Automatically adds the Content-Length header according to the request body.

> httpforge -b "username=foo&password=bar" -l
GET / HTTP/1.0
Content-Length: 25

username=foo&password=bar

Examples

Request the HEAD for /doku.php on www.aspyct.org

> httpforge -m HEAD -u "/doku.php" -s "Host: www.aspyct.org"
HEAD /doku.php HTTP/1.0
Host: www.aspyct.org

Modify a stored request to adapt to a specific host

> httpforge -a -s "Host: www.aspyct.org" < request
POST /doku.php HTTP/1.0
Content-Length: 28
Host: www.aspyct.org

username=admin&password=pass

Table Of Contents

Previous topic

Intro

This Page