httpx
httpx copied to clipboard
Header field update (json output)
Please describe your feature request:
When -irr option is used with JSON output, the response header fields contain values for the response header that can be updated to make it more readable/usable for automation and post-processing.
echo scanme.sh | ./httpx -json -silent -irr | jq .
Current format:
"header": "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: 2\r\nContent-Type: text/plain; charset=utf-8\r\nDate: Tue, 30 Aug 2022 12:57:22 GMT\r\n\r\n",
After update:
"header": {
"connection": "close",
"content_length": 2,
"content_type": "text/plain; charset=utf-8",
"date": "Tue, 30 Aug 2022 12:57:22 GMT"
}
Note:
Header keys need to normalize for uniformity:
- lowercase keys
- replace
-(dash) with_(underscore) in keys - Check if
header_rawhaving original values can be useful