Simple HTTP server receiving requests and dumping to flat file.
Start the listening HTTP server:
root# nodejs ./httprequestdump.js
Listening on 0.0.0.0:8080
Now make a curl
request:
root# curl --data-urlencode "param1=value" --data-urlencode "param2=value" --verbose http://127.0.0.1:8080/my/path/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /my/path/ HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 127.0.0.1:8080
> Accept: */*
> Content-Length: 25
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 25 out of 25 bytes
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: Fri, 27 May 2016 05:37:56 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
HELLO
* Connection #0 to host 127.0.0.1 left intact
And view the response:
Incoming request
Method: POST
URI: /my/path/
End of request, 25 bytes received.
root# cat dumpdata.txt
Method: POST
URI: /my/path/
Headers:
accept: */*
content-length: 25
content-type: application/x-www-form-urlencoded
host: 127.0.0.1:8080
user-agent: curl/7.35.0
param1=value¶m2=value