[{"data":1,"prerenderedAt":134},["ShallowReactive",2],{"blog-post-httpie-pretty-print-json":3,"recent-posts":89},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":11,"slugs":12,"linked_documents":14,"lang":15,"alternate_languages":16,"data":17},"awGsBRIAAC0AFqOw","httpie-pretty-print-json",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awsGbRMAAC0AzaWS&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awGsBRIAAC0AFqOw%22%29+%5D%5D",[],"2026-11-27T22:46:01+0000","2026-11-28T16:50:52+0000",[13],"httpie-how-to-pretty-print-json",[],"en-us",[],{"title":18,"date":24,"description":25,"image":30,"content":40},[19],{"type":20,"text":21,"spans":22,"direction":23},"heading1","HTTPie: How to Pretty Print JSON",[],"ltr","2026-11-27",[26],{"type":27,"text":28,"spans":29,"direction":23},"heading2","Learn how to pretty print JSON in the terminal using HTTPie",[],{"dimensions":31,"alt":21,"copyright":6,"url":34,"id":35,"edit":36},{"width":32,"height":33},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FlCNUDBWv_1DmEc9s_httpie-pretty-print-json.png?auto=format,compress","lCNUDBWv_1DmEc9s",{"x":37,"y":37,"zoom":38,"background":39},0,1,"transparent",[41,45,49,52,55,58,61,64,67,70,86],{"type":42,"text":43,"spans":44,"direction":23},"paragraph","Before we start, make sure you have \u003Ccode>HTTPie\u003C\u002Fcode> installed on your computer and a URL that returns JSON. If you don't have HTTPie yet, you can install it with Homebrew:",[],{"type":46,"text":47,"spans":48,"direction":23},"preformatted","brew install httpie",[],{"type":42,"text":50,"spans":51,"direction":23},"First, open your terminal. HTTPie pretty prints JSON for you, so to get a nicely formatted response, run this command:",[],{"type":46,"text":53,"spans":54,"direction":23},"http -b localhost:8080\u002Forders.json",[],{"type":42,"text":56,"spans":57,"direction":23},"Just remember to replace \u003Ccode>localhost:8080\u002Forders.json\u003C\u002Fcode> with your own URL. The \u003Ccode>-b\u003C\u002Fcode> flag only shows the response body, so the headers stay out of the way. HTTPie adds colors, indents the JSON with four spaces and sorts the keys alphabetically.",[],{"type":42,"text":59,"spans":60,"direction":23},"If you want a different indentation, change it with the \u003Ccode>--format-options\u003C\u002Fcode> flag:",[],{"type":46,"text":62,"spans":63,"direction":23},"http -b --format-options json.indent:2 localhost:8080\u002Forders.json",[],{"type":42,"text":65,"spans":66,"direction":23},"One thing to know: when you pipe HTTPie into another command, it turns the formatting off. To keep it, add \u003Ccode>--pretty=format\u003C\u002Fcode>, or use \u003Ccode>--pretty=all\u003C\u002Fcode> if you want the colors too:",[],{"type":46,"text":68,"spans":69,"direction":23},"http -b --pretty=format localhost:8080\u002Forders.json | head -4",[],{"type":71,"oembed":72},"embed",{"embed_url":73,"type":74,"version":75,"title":21,"author_name":76,"author_url":77,"provider_name":78,"provider_url":79,"thumbnail_url":80,"thumbnail_width":81,"thumbnail_height":82,"html":83,"height":84,"width":85},"https:\u002F\u002Fyoutu.be\u002FFkpZlCkVDqc","video","1.0","markster","https:\u002F\u002Fwww.youtube.com\u002F@markster1904","YouTube","https:\u002F\u002Fwww.youtube.com\u002F","https:\u002F\u002Fi.ytimg.com\u002Fvi\u002FFkpZlCkVDqc\u002Fhqdefault.jpg",480,360,"\u003Ciframe width=\"200\" height=\"113\" src=\"https:\u002F\u002Fwww.youtube.com\u002Fembed\u002FFkpZlCkVDqc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen title=\"HTTPie: How to Pretty Print JSON\">\u003C\u002Fiframe>",113,200,{"type":42,"text":87,"spans":88,"direction":23},"If you'd rather keep the keys in their original order, just add \u003Ccode>--unsorted\u003C\u002Fcode> to the command.",[],{"results":90,"page":38,"results_per_page":132,"results_size":132,"total_results_size":133,"total_pages":38},[91,93,113],{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":11,"slugs":12,"linked_documents":14,"lang":15,"alternate_languages":16,"data":92},{"image":30,"title":18},{"id":94,"uid":95,"url":6,"type":7,"href":96,"tags":97,"first_publication_date":10,"last_publication_date":11,"slugs":98,"linked_documents":100,"lang":15,"alternate_languages":101,"data":102},"awGsAhIAACkAFqOe","bat-git-diff","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awsGbRMAAC0AzaWS&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awGsAhIAACkAFqOe%22%29+%5D%5D",[],[99],"bat-how-to-use-it-with-git-diff",[],[],{"image":103,"title":109},{"dimensions":104,"alt":105,"copyright":6,"url":106,"id":107,"edit":108},{"width":32,"height":33},"Bat: How to Use It with git diff","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002Fhv5njvdg6CY6UfYl_bat-git-diff.png?auto=format,compress","hv5njvdg6CY6UfYl",{"x":37,"y":37,"zoom":38,"background":39},[110],{"type":20,"text":111,"spans":112,"direction":23},"Bat: How to Use It with 'git diff'",[],{"id":114,"uid":115,"url":6,"type":7,"href":116,"tags":117,"first_publication_date":10,"last_publication_date":11,"slugs":118,"linked_documents":120,"lang":15,"alternate_languages":121,"data":122},"awGsBBIAACsAFqOq","bat-hide-file-header","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awsGbRMAAC0AzaWS&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awGsBBIAACsAFqOq%22%29+%5D%5D",[],[119],"bat-how-to-hide-the-file-header",[],[],{"image":123,"title":129},{"dimensions":124,"alt":125,"copyright":6,"url":126,"id":127,"edit":128},{"width":32,"height":33},"Bat: How to Hide the File Header","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F7ZkXhTyVPYMIyYzS_bat-hide-file-header.png?auto=format,compress","7ZkXhTyVPYMIyYzS",{"x":37,"y":37,"zoom":38,"background":39},[130],{"type":20,"text":125,"spans":131,"direction":23},[],3,104,1795884710196]