HTTPie

repository·master·Indexed 12 days ago

https://github.com/httpie/cli

A human-friendly command-line HTTP client for testing, debugging, and interacting with web services and APIs. This documentation covers installation, release processes, and packaging guides for various platforms including Homebrew, Arch Linux, CentOS, RHEL, Debian, Ubuntu, Fedora, Snap, and Chocolatey.

Tokens
16K
Snippets
58
Records
86
Agent score
97%

What's inside HTTPie

  1. HTTPie CLI Features

    master

    HTTPie provides several built-in capabilities for modern API interaction:

    • Expressive Syntax: Intuitive command-line interface.
    • Formatted Output: Colorized and human-readable terminal output.
    • JSON Support: Built-in handling for JSON data.
    • Data Types: Support for forms and file uploads.
    • Connectivity: Support for HTTPS, proxies, and authentication.
    • Flexibility: Ability to send arbitrary request data and custom headers.
    • State: Persistent sessions.
    • Downloads: wget-like download capabilities.
  2. How the HTTPie Snap release process works

    master

    The HTTPie Snap release is managed via a GitHub Action (release-snap.yml). Triggering this action creates a snap package and pushes it to the Snap Store across four specific channels:

    • edge
    • beta
    • candidate
    • stable

    If a push to any channel fails, all subsequent release tasks for the remaining channels are cancelled to allow the release manager to investigate.

  3. How HTTPie is packaged for Debian and Ubuntu

    master

    HTTPie is packaged for Debian GNU/Linux and its derivatives (such as Ubuntu, Linux Mint, Pop!_OS, etc.) using standalone binaries. These binaries are packaged using FPM's dir mode.

    Dependency Note:

    • The core http and https commands have no dependencies.
    • The httpie command depends on the system Python (via python3 and python3-pip) to support the httpie cli plugins interface.
  4. Understand the HTTPie update process on Fedora

    master

    New versions of HTTPie are not backported automatically. The update lifecycle follows these steps:

    1. Release: A new HTTPie release is created on GitHub.
    2. Rawhide PR: A pull request is created for Fedora rawhide (the development version).
    3. Merge & Build: A Fedora packager reviews, merges, and builds the PR. HTTPie is typically updated in rawhide within 24 hours.
    4. Stable Decision: A packager decides if the upgrade is suitable for stable Fedora releases (e.g., Fedora 35, 34, 33).
    5. Testing & Availability: If approved, the version lands in the updates-testing repository for user feedback. After approximately one week of testing, it becomes broadly available in stable repositories.
  5. How new HTTPie versions are updated on CentOS

    master

    New versions of HTTPie are tracked via release-monitoring, which triggers a BugZilla ticket when a new release is published.

    While the system attempts to automate spec file updates, manual revision is often required for CentOS. Maintainers must manually check for:

    • Dependency changes (e.g., requiring defuxedxml for version 2.5.0).
    • License changes.
    • New binaries, documentation, or other package contents.
  6. Understand the HTTPie Linux build process

    master

    The Linux packaging logic is driven by build.py and uses the following tools and strategies:

    Binary Generation (build_binaries)

    HTTPie uses PyInstaller in single binary mode. This produces a single executable that is easy to distribute by statically linking libraries, despite a slightly larger file size. Note that UPX decompression is disabled to avoid startup latency.

    OS Package Generation (build_packages)

    OS-specific packages (.deb, .rpm) are built using FPM in dir mode. The packages include the http, https, and httpie commands. Because HTTPie requires a pip executable, these packages explicitly depend on the system Python.

    Environment Isolation (Docker)

    A Dockerfile is provided to build binaries in an isolated environment with minimal library versions. This ensures compatibility across various Ubuntu/Debian versions by building against an older (but not deprecated) version of glibc.

  7. The HTTPie release process

    master

    The release process for HTTPie involves version bumping, tagging, and multi-platform distribution.

    Release Steps:

    1. Bump version identifiers in:
      • httpie/__init__.py
      • docs/packaging/windows-chocolatey/httpie.nuspec
      • CHANGELOG.md
    2. Commit changes and create a PR against master.
    3. Merge the PR and tag the last commit with the version identifier.
    4. Create a GitHub release using the text from CHANGELOG.md.
    5. Push the release to PyPI (using the Release PyPI GitHub action).
    6. Once PyPI is ready, push the release to Snap, Homebrew, and Chocolatey using their respective GitHub actions.
    7. Trigger the package index workflow in the httpie/debian.httpie.io repository.
  8. Packaging HTTPie for CentOS, RHEL, and derived distributions

    master

    This guide provides technical details for creating and maintaining patches for the latest HTTPie version on CentOS, RHEL, and RHEL-derived distributions (such as Oracle Linux or ClearOS). The process involves setting up a development environment, installing necessary tools, and testing changes before submitting patches downstream.

    For standard installation or upgrade instructions, refer to the official HTTPie documentation.

  9. Develop and test HTTPie Snap packages locally

    master

    To hack on the HTTPie Snap packaging, you should use a Docker container to ensure a clean environment. Follow these steps to clone, build, install, and test the snap locally.

    1. Launch the development environment

    Pull and run the latest Ubuntu image:

    docker pull ubuntu/latest
    docker run -it --rm ubuntu/latest

    2. Clone and Build

    Inside the container, clone the repository and run snapcraft with specific resource allocations:

    git clone --depth=1 https://github.com/httpie/cli.git
    cd httpie
    export SNAPCRAFT_BUILD_ENVIRONMENT_CPU=8
    export SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G
    snapcraft --debug

    3. Install and Test

    Install the generated .snap file using the --dangerous flag (required for local files not from the store).

    Note: Auto-aliases (like http and https) cannot be tested when installing a snap manually outside of the Snap Store. You must use the explicit httpie.http and httpie.https commands for testing.

    sudo snap install --dangerous httpie_XXX_amd64.snap
    
    # Test using explicit commands
    httpie.http --version
    httpie.https --version

    4. Cleanup

    To remove the locally installed snap:

    sudo snap remove httpie
    # Clone
    git clone --depth=1 https://github.com/httpie/cli.git
    cd httpie
    
    # Build
    export SNAPCRAFT_BUILD_ENVIRONMENT_CPU=8
    export SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G
    snapcraft --debug
    
    # Install
    sudo snap install --dangerous httpie_XXX_amd64.snap
    
    # Test
    httpie.http --version
    httpie.https --version
    
    # Remove
    sudo snap remove httpie
  10. Manually bump the HTTPie Homebrew formula

    master

    If you need to manually trigger a version bump for the HTTPie Homebrew formula (instead of using the automated release workflow), use the brew bump-formula-pr command. This will update the formula to the specified version and automatically create a Pull Request against the Homebrew package index.

    $ brew bump-formula-pr httpie --version={TARGET_VERSION}
  11. Develop and test HTTPie Chocolatey packages locally

    master

    To work on the HTTPie Chocolatey packaging (hacking), follow these steps to set up your environment, build the package, and verify it via a local installation:

    1. Clone the repository and navigate to the packaging directory.
    2. Build the package using choco pack.
    3. Check metadata to ensure the package is correctly formed using choco info.
    4. Install the package locally using choco install pointing to the current directory and the community repository.
    5. Verify the installation by checking the versions of http and https.
    6. Remove the package using choco uninstall to clean up your environment.
    # Clone
    git clone --depth=1 https://github.com/httpie/cli.git
    cd httpie/docs/packaging/windows-chocolatey
    
    # Build
    choco pack
    
    # Check metadata
    choco info httpie -s .
    
    # Install
    choco install httpie -y -dv -s "'.*;https://community.chocolatey.org/api/v2/'"
    
    # Test
    http --version
    https --version
    
    # Remove
    choco uninstall -y httpie