{"id":4566,"library":"httpie","title":"HTTPie","description":"HTTPie is a modern, user-friendly command-line HTTP client for the API era, designed to make API interaction intuitive and efficient. The current version is 3.2.4, and it maintains an active release cadence with frequent patch and minor updates.","status":"active","version":"3.2.4","language":"en","source_language":"en","source_url":"https://github.com/httpie/cli","tags":["http","cli","api","client","developer-tool"],"install":[{"cmd":"pip install httpie","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core HTTP client functionality, subject to version-specific fixes in HTTPie releases.","package":"requests","optional":false},{"reason":"Underlying HTTP connection pool management, also subject to compatibility fixes.","package":"urllib3","optional":false}],"imports":[{"note":"HTTPie is primarily a CLI tool. While `httpie.core.call_main` allows programmatic execution, its API is not officially stable and may change without notice. For robust programmatic use, running HTTPie as a subprocess is often recommended.","wrong":"import httpie; httpie.get(...)","symbol":"call_main","correct":"from httpie.core import call_main"}],"quickstart":{"code":"import subprocess\nfrom httpie.core import call_main\n\n# Recommended: Run HTTPie as a subprocess\nprint(\"--- Using subprocess (recommended) ---\")\ntry:\n    result = subprocess.run(['http', 'https://httpbin.org/get', 'X-Auth-Token: ' + os.environ.get('HTTP_AUTH_TOKEN', 'none')], capture_output=True, text=True, check=True)\n    print(result.stdout)\nexcept subprocess.CalledProcessError as e:\n    print(f\"Subprocess failed: {e}\\n{e.stderr}\")\n\n# Alternative: Use the internal call_main (API not guaranteed stable)\nprint(\"\\n--- Using httpie.core.call_main (experimental) ---\")\n# Redirect stdout/stderr to capture output, as call_main prints directly\nimport io\nimport sys\n\nold_stdout = sys.stdout\nredirected_output = io.StringIO()\nsys.stdout = redirected_output\n\ntry:\n    # call_main expects a list of CLI arguments\n    args = ['https://httpbin.org/post', 'hello=world', 'Content-Type: application/json']\n    status_code = call_main(args)\n    print(f\"Call main exited with status: {status_code}\")\n    print(redirected_output.getvalue())\nfinally:\n    sys.stdout = old_stdout # Restore stdout\n\n# Example of setting an environment variable for a subprocess call\nimport os\nos.environ['HTTP_TEST_VAR'] = 'test_value'\nprint(\"\\n--- Subprocess with environment variable ---\")\ntry:\n    result_env = subprocess.run(['http', 'https://httpbin.org/get', 'HTTP_TEST_VAR'], capture_output=True, text=True, check=True)\n    print(result_env.stdout)\nexcept subprocess.CalledProcessError as e:\n    print(f\"Subprocess failed: {e}\\n{e.stderr}\")\n\ndel os.environ['HTTP_TEST_VAR'] # Clean up","lang":"python","description":"This quickstart demonstrates both the recommended way of using HTTPie programmatically (as a subprocess) and the experimental direct `call_main` API. The subprocess method provides stability and mimics standard CLI usage. Remember to set `HTTP_AUTH_TOKEN` in your environment for the auth example."},"warnings":[{"fix":"Upgrade Python to 3.7 or newer, or pin `httpie<3.0.0`.","message":"HTTPie v3.0.0 and later dropped support for Python 3.6. Users on older Python versions must upgrade Python or stick to HTTPie versions < 3.0.0.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"For stable programmatic integration, it is generally recommended to run HTTPie as a subprocess, parsing its standard output and error streams. This mirrors how the CLI is intended to be used.","message":"The `httpie.core` programmatic API (e.g., `call_main`) is not officially stable and is subject to change between versions without a dedicated deprecation cycle. Direct programmatic interaction should be used with caution.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure you are running the latest patch release of HTTPie to benefit from the most recent dependency compatibility fixes. If encountering SSL issues, check the HTTPie GitHub releases for recent fixes.","message":"HTTPie has experienced issues with SSL connections and compatibility with underlying `requests` and `urllib3` versions in the past (e.g., 3.2.2, 3.2.3, 3.2.4 patches). While often resolved quickly, this indicates sensitivity to its core dependencies.","severity":"gotcha","affected_versions":"3.2.2, 3.2.3, 3.2.4 (fixed in these respective versions)"},{"fix":"Upgrade to HTTPie v3.1.0 or newer immediately to mitigate the cookie exposure vulnerability. Regularly update HTTPie to receive security patches.","message":"HTTPie v3.1.0 fixed a critical security vulnerability related to cookie exposure on redirects to third-party hosts. While fixed, relying on older versions could expose users to this vulnerability.","severity":"deprecated","affected_versions":"<3.1.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}