httpextract

httpextract reads a HTTP response from standard input and extracts a part of it, be it the head, the status line, a header...

The examples below assume a response has been saved in a file with this command

> httpforge -s "Host: www.aspyct.org" | httpsend > response

Parts

For readability reasons, httpextract always adds a newline at the end of the output. Don’t forget to remove it when required.

body

Removes the head of the message, leaving only the body.

> httpextract body < response
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
[etc...]

status

Prints the status line.

> httpextract status < response
HTTP/1.1 200 OK

code

Prints the response code.

> httpextract code < response
200

protocol

Prints the response protocol version.

> httpextract protocol < response
1.1

Table Of Contents

Previous topic

httpsend

This Page