HTTPie API Debugging: Test and Inspect HTTP Requests

Question: How do I debug an HTTP API quicker than with curl?

Try: http --print=HBhb --verify=yes https://api.example.com/users/42

Info: Prints colored request and response headers and bodies, making HTTP API debugging easier and more readable.

Examples:

  • $ http POST api.example.com/users name=John age:=34  # Send JSON body with typed values
  • $ http --session=api api.example.com/me Authorization:'Bearer TOKEN'  # Persist authentication and session state
  • $ http --download https://example.com/file.zip  # Download files with a progress bar

Note: Install via sudo apt install httpie. HTTPie formats JSON automatically, simplifies headers and authentication, and provides a clean alternative to curl for API testing. Avoid storing real access tokens in shared or unprotected session files.

Read more here: Source link