[{"data":1,"prerenderedAt":124},["ShallowReactive",2],{"blog-post-httpie-set-timeout":3,"recent-posts":80},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"awME1xIAACcAGIiu","httpie-set-timeout",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=aw38fRMAACoA0hep&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awME1xIAACcAGIiu%22%29+%5D%5D",[],"2026-11-30T22:45:17+0000",[12],"httpie-how-to-set-a-timeout",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","HTTPie: How to Set a Timeout",[],"ltr","2026-11-30",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to set a request timeout in the terminal using HTTPie",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FNJACEouTVfMOY7Tq_httpie-set-timeout.png?auto=format,compress","NJACEouTVfMOY7Tq",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,51,54,57,60,64,67,70,73,77],{"type":41,"text":42,"spans":43,"direction":22},"paragraph","Before we start, make sure you have \u003Ccode>HTTPie\u003C\u002Fcode> installed on your computer. If you don't have it yet, you can install it with Homebrew:",[],{"type":45,"text":46,"spans":47,"direction":22},"preformatted","brew install httpie",[],{"type":41,"text":49,"spans":50,"direction":22},"By default, HTTPie has no timeout at all, so it waits forever for a slow server. To set one, open your terminal and run this command:",[],{"type":45,"text":52,"spans":53,"direction":22},"http --timeout=5 https:\u002F\u002Fexample.com",[],{"type":41,"text":55,"spans":56,"direction":22},"Just replace \u003Ccode>https:\u002F\u002Fexample.com\u003C\u002Fcode> with your own URL. The \u003Ccode>--timeout\u003C\u002Fcode> flag takes the number of seconds to wait, and decimals work too, like \u003Ccode>--timeout=2.5\u003C\u002Fcode>. Put it before the URL.",[],{"type":41,"text":58,"spans":59,"direction":22},"If the server takes longer than that, HTTPie gives up and prints \u003Ccode>http: error: Request timed out (5.0s).\u003C\u002Fcode> If the server answers in time, you just get the normal response, so don't worry about setting it a little higher than you need.",[],{"type":61,"text":62,"spans":63,"direction":22},"heading3","Set a Default Timeout",[],{"type":41,"text":65,"spans":66,"direction":22},"To use a timeout on every request, add it to \u003Ccode>default_options\u003C\u002Fcode> in HTTPie's config file. On macOS and Linux it lives at \u003Ccode>~\u002F.config\u002Fhttpie\u002Fconfig.json\u003C\u002Fcode>, and on Windows at \u003Ccode>%APPDATA%\\httpie\\config.json\u003C\u002Fcode>:",[],{"type":45,"text":68,"spans":69,"direction":22},"{\n  \"default_options\": [\n    \"--timeout=10\"\n  ]\n}",[],{"type":41,"text":71,"spans":72,"direction":22},"Now a plain \u003Ccode>http\u003C\u002Fcode> command uses that timeout without any flags.",[],{"type":74,"oembed":75},"embed",{"embed_url":76,"type":74},"",{"type":41,"text":78,"spans":79,"direction":22},"If you need more time for one request, just pass \u003Ccode>--timeout\u003C\u002Fcode> on the command. It's added after the default options, so it wins.",[],{"results":81,"page":37,"results_per_page":122,"results_size":122,"total_results_size":123,"total_pages":37},[82,101,120],{"id":83,"uid":84,"url":6,"type":7,"href":85,"tags":86,"first_publication_date":10,"last_publication_date":10,"slugs":87,"linked_documents":89,"lang":14,"alternate_languages":90,"data":91},"awME2xIAAC4AGIjI","httpie-call-api","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=aw38fRMAACoA0hep&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awME2xIAAC4AGIjI%22%29+%5D%5D",[],[88],"httpie-how-to-call-an-api",[],[],{"image":92,"title":98},{"dimensions":93,"alt":94,"copyright":6,"url":95,"id":96,"edit":97},{"width":31,"height":32},"HTTPie: How to Call an API","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F7pbAxf65Suc2BEef_httpie-call-api.png?auto=format,compress","7pbAxf65Suc2BEef",{"x":36,"y":36,"zoom":37,"background":38},[99],{"type":19,"text":94,"spans":100,"direction":22},[],{"id":102,"uid":103,"url":6,"type":7,"href":104,"tags":105,"first_publication_date":10,"last_publication_date":10,"slugs":106,"linked_documents":108,"lang":14,"alternate_languages":109,"data":110},"awME2RIAACsAGIi6","httpie-send-form-data","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=aw38fRMAACoA0hep&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awME2RIAACsAGIi6%22%29+%5D%5D",[],[107],"httpie-how-to-send-form-data",[],[],{"image":111,"title":117},{"dimensions":112,"alt":113,"copyright":6,"url":114,"id":115,"edit":116},{"width":31,"height":32},"HTTPie: How to Send Form Data","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F7X04DUTJrHRMODNb_httpie-send-form-data.png?auto=format,compress","7X04DUTJrHRMODNb",{"x":36,"y":36,"zoom":37,"background":38},[118],{"type":19,"text":113,"spans":119,"direction":22},[],{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":121},{"image":29,"title":17},3,109,1796078741473]