Skip to content

Instantly share code, notes, and snippets.

@pib
Created February 4, 2013 21:32
Show Gist options
  • Save pib/4709896 to your computer and use it in GitHub Desktop.
Save pib/4709896 to your computer and use it in GitHub Desktop.
Sometimes you just want to see a raw, incoming HTTP request.
BODY="$1"
if [ -z "$1" ]; then
BODY="OK"
fi
{
echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(echo $BODY| wc -c)\r\n\r\n"
echo $BODY
} | nc -l 8080 -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment