httpcode icon indicating copy to clipboard operation
httpcode copied to clipboard

Add flag to output structured data

Open ZevEisenberg opened this issue 5 years ago • 0 comments

I just integrated httpcode into a LaunchBar action so I have a convenient micro-GUI for searching HTTP status codes. It would be nice to have structured output, probably as JSON, so I can easily do additional formatting without having to do best-guess parsing of the output format. For example, I'd love to see something like:

hc --json 40[12]
[
  {
    "code": "401",
    "message": "Unauthorized",
    "explanation": "No permission -- see authorization schemes"
  },
  {
    "code": "402",
    "message": "Payment Required",
    "explanation": "No payment -- see charging schemes"
  }
]

ZevEisenberg avatar Mar 24 '21 20:03 ZevEisenberg