davecheney / httpstat

It's like curl -v, with colours.
MIT License
6.95k stars 382 forks source link

Add JSON output support #131

Open rs opened 6 years ago

rs commented 6 years ago

Example output (whitespace and carriage returns added for readibility):

{
  "Address": "128.199.248.140:443",
  "Header": {
    "Connection": [
      "keep-alive"
    ],
    "Content-Type": [
      "text/html; charset=UTF-8"
    ],
    "Date": [
      "Sat, 05 May 2018 03:15:15 GMT"
    ],
    "Link": [
      "<https://dave.cheney.net/wp-json/>; rel=\"https://api.w.org/\""
    ],
    "Server": [
      "nginx/1.2.1"
    ],
    "Strict-Transport-Security": [
      "max-age=15768000"
    ],
    "X-Powered-By": [
      "PHP/5.4.45-0+deb7u11"
    ]
  },
  "Proto": "HTTP/1.1",
  "Status": "200 OK",
  "Timing": {
    "DNS": 98,
    "TCP": 191,
    "TLS": 604,
    "Server": 747,
    "Transfer": 392,
    "Lookup": 98,
    "Connect": 290,
    "PreTransfer": 895,
    "StartTransfer": 1643,
    "Total": 2036
  }
}
rs commented 6 years ago

This PR is based on #128

davecheney commented 6 years ago

This PR is dirty, please rebase it onto master.

Each PR should close an issue, with a Fixes #nnnn

On 5 May 2018, at 13:22, Olivier Poitrey notifications@github.com wrote:

This PR is based on #128

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rs commented 6 years ago

As explained in the previous comment, this PR is based on #128. I'm waiting for it to be merged before rebasing on master.

I sent this PR to share a feature I added for my own use. There is no issue associated, it fixes nothing. I can open a separate issue if it's the way you want it.