Created
February 4, 2013 21:32
-
-
Save pib/4709896 to your computer and use it in GitHub Desktop.
Sometimes you just want to see a raw, incoming HTTP request.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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