astaxie / bat

Go implement CLI, cURL-like tool for humans
Apache License 2.0
2.55k stars 220 forks source link

use a real regex for the json content-type header #51

Closed MaximilianMeister closed 8 years ago

MaximilianMeister commented 8 years ago

this enables to match custom/vendored types that have a json format like e.g.: application/vnd.bat.v0.0.2+json

this is a widespread common pattern, and if you talk to an API that only accepts this mediatype, the output will be returned as a normal string, even if it can be decoded as json.

this patch enables to print a pretty version of that json response by default, so it gets treated like any default application/json type.