A simple web debug server echoing requests. Send a something and retrieve a json response resembling the request's information.
$ curl http://localhost:9999?name=john
{
"Host": "localhost:9999",
"Method": "GET",
"Proto": "HTTP/1.1",
"Request": {
"Body": "",
"Headers": {
"Accept": [
"*/*"
],
"User-Agent": [
"curl/7.74.0"
]
},
"Params": {
"name": [
"john"
]
}
},
"URL": "/?name=james"
}$ curl -X POST -F 'os=linux' http://localhost:9999
{
"Host": "localhost:9999",
"Method": "POST",
"Proto": "HTTP/1.1",
"Request": {
"Body": "--------------------------d11f137cf722c9c9\r\nContent-Disposition: form-data; name=\"os\"\r\n\r\nlinux\r\n--------------------------d11f137cf722c9c9--\r\n",
"Headers": {
"Accept": [
"*/*"
],
"Content-Length": [
"142"
],
"Content-Type": [
"multipart/form-data; boundary=------------------------d11f137cf722c9c9"
],
"User-Agent": [
"curl/7.74.0"
]
},
"Params": {}
},
"URL": "/"
}Custom response status codes can be set through the called url. Use /status/ and append the required integer. I.e. /status/404 responds with a 404 status code and so on.
simplewebserverfordebuggingpurposesFlags:
-h, --helpShowcontext-sensitivehelp.
-p, --port=9999portwheretoserve-b, --basic-auth=USER:PASS:...enablebasicauth-r, --response-delay=RESPONSE-DELAY,...serverresponsedelayinms, usetwicetodefinerangeforarandomvaluebeforeeachrequest-j, --json-logenablejsonlog, insteadoftextone-l, --log-file="/dev/stdout" logfile-v, --verboseverbosemode, printfullresponsedataset-V, --version-flagdisplayversion