Forrest logo
back to the http tool

httpie:tldr:12760

httpie: Follow redirects and show intermediary requests and responses.
$ http --follow --all ${https:--example-com}
try on your machine

The command you shared is using the HTTPie tool, a user-friendly command-line HTTP client for making HTTP requests.

Now, let's break down the command:

  • http: This is the keyword to call the HTTPie tool.

  • --follow: This flag is used to instruct HTTPie to automatically follow any redirects it encounters while making the request. In other words, if the server responds with a redirect (e.g., HTTP 301 or 302 status code), HTTPie will automatically make a new request to the new location provided by the redirect.

  • --all: This flag tells HTTPie to display the entire HTTP exchange, including request and response headers, as well as the response body. By default, HTTPie only displays the response body.

  • ${https:--example-com}: This syntax is used to pass options (URL and/or headers) to HTTPie. In this case, it's providing the URL to make the request to, which is https://example.com. The ${https:--example-com} part is a way to conditionally set the URL based on whether the https environment variable is set or not. If the https variable is set, it will use its value as the URL; otherwise, it will default to --example-com as the URL.

Therefore, when executing this command, HTTPie will make an HTTP request to https://example.com, and if there are any redirects, it will automatically follow them and display the entire exchange of headers and bodies for each request and response made.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the http tool