Convert Figma logo to code with AI

httpie logocli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.

35,470
3,709
35,470
192

Top Related Projects

36,210

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.

23,382

Guzzle, an extensible PHP HTTP client

52,800

A simple, yet elegant, HTTP library.

38,211

A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features

Quick Overview

HTTPie (pronounced aitch-tee-tee-pie) is a user-friendly command-line HTTP client for the API era. It provides a simple and intuitive syntax for making HTTP requests, with features like syntax highlighting, formatting, and session support. HTTPie is designed to make CLI interaction with web services as human-friendly as possible.

Pros

  • Intuitive and user-friendly syntax for HTTP requests
  • Colorized output with syntax highlighting for improved readability
  • Built-in JSON support and formatting
  • Supports sessions and authentication out of the box

Cons

  • May be overkill for simple HTTP requests where curl suffices
  • Learning curve for users accustomed to traditional curl commands
  • Limited built-in scripting capabilities compared to curl

Code Examples

  1. Making a simple GET request:
http GET https://api.example.com/users

This command sends a GET request to the specified URL and displays the formatted response.

  1. Sending JSON data in a POST request:
http POST https://api.example.com/users name=John age:=30

This example sends a POST request with JSON data, where name is a string and age is a number.

  1. Using custom headers and authentication:
http -a username:password POST https://api.example.com/data X-Custom-Header:Value

This command sends a POST request with Basic Authentication and a custom header.

Getting Started

To get started with HTTPie, follow these steps:

  1. Install HTTPie:

    pip install httpie
    
  2. Make your first request:

    http GET https://api.github.com/repos/httpie/cli
    
  3. Explore more features in the documentation: HTTPie Documentation

For more advanced usage and options, refer to the official documentation.

Competitor Comparisons

36,210

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.

Pros of Insomnia

  • Graphical user interface for easier request building and visualization
  • Supports GraphQL and gRPC in addition to REST APIs
  • Collaborative features for team environments

Cons of Insomnia

  • Steeper learning curve for command-line enthusiasts
  • Less suitable for quick, one-off API requests
  • Requires more system resources as a desktop application

Code Comparison

HTTPie CLI:

http POST api.example.com/users name=John age:=30

Insomnia (JavaScript for Insomnia Plugin):

const response = await insomnia.send({
  url: 'api.example.com/users',
  method: 'POST',
  body: { name: 'John', age: 30 }
});

Key Differences

  • HTTPie is a command-line tool, while Insomnia is a GUI application
  • HTTPie focuses on simplicity and ease of use for HTTP requests
  • Insomnia offers a more comprehensive set of features for API development and testing

Use Cases

HTTPie is ideal for:

  • Quick API checks from the terminal
  • Scripting and automation tasks
  • Users comfortable with command-line interfaces

Insomnia is better suited for:

  • Complex API testing and development
  • Teams collaborating on API projects
  • Developers who prefer visual interfaces

Both tools have their strengths, and the choice depends on personal preference and specific project requirements.

23,382

Guzzle, an extensible PHP HTTP client

Pros of Guzzle

  • More comprehensive PHP HTTP client library with extensive features
  • Better suited for complex API integrations and advanced HTTP operations
  • Supports both synchronous and asynchronous requests

Cons of Guzzle

  • Steeper learning curve for beginners compared to HTTPie's simplicity
  • Primarily designed for PHP, limiting its use in other environments
  • Requires more setup and configuration for basic tasks

Code Comparison

HTTPie CLI example:

http GET https://api.example.com/users

Guzzle example:

$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.example.com/users');

HTTPie focuses on simplicity and ease of use for command-line HTTP interactions, while Guzzle provides a more robust and feature-rich PHP HTTP client library. HTTPie is ideal for quick API testing and simple HTTP requests, whereas Guzzle excels in complex PHP applications requiring advanced HTTP functionality.

HTTPie's command-line interface makes it accessible across various platforms and languages, while Guzzle is specifically tailored for PHP developers. The choice between the two depends on the specific use case, development environment, and the level of HTTP functionality required in the project.

52,800

A simple, yet elegant, HTTP library.

Pros of Requests

  • More comprehensive and flexible API for HTTP requests
  • Extensive documentation and widespread community support
  • Better suited for integration into larger Python projects

Cons of Requests

  • Lacks a built-in command-line interface
  • May require more code for simple tasks compared to HTTPie
  • No native support for colorized output or formatting

Code Comparison

Requests:

import requests

response = requests.get('https://api.example.com/data')
print(response.json())

HTTPie:

from httpie.cli.constants import DEFAULT_ENCODING
from httpie.cli.exceptions import ParseError
from httpie.cli.definition import HTTPieArgumentParser

parser = HTTPieArgumentParser()
args = parser.parse_args(['GET', 'https://api.example.com/data'])

Summary

Requests is a powerful Python library for making HTTP requests, offering a comprehensive API and extensive documentation. It's ideal for integration into larger Python projects but lacks a built-in CLI. HTTPie, on the other hand, provides a user-friendly command-line interface with colorized output, making it more suitable for quick testing and debugging. While Requests offers more flexibility, HTTPie excels in simplicity for command-line usage.

38,211

A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features

Pros of curl

  • More extensive protocol support (FTP, SFTP, SCP, etc.)
  • Wider platform compatibility and availability
  • Deeper customization options for advanced users

Cons of curl

  • Less user-friendly syntax for beginners
  • Output formatting not as visually appealing
  • Requires more manual configuration for common tasks

Code Comparison

HTTPie:

http POST api.example.com/users name=John age:=30

curl:

curl -X POST -H "Content-Type: application/json" -d '{"name":"John","age":30}' api.example.com/users

HTTPie provides a more intuitive and readable syntax for HTTP requests, especially for JSON payloads. The := syntax for numbers and booleans is particularly convenient. curl requires more verbose command-line options and manual JSON formatting.

Both tools are powerful and widely used, with curl being more versatile for various protocols and HTTPie focusing on user-friendly HTTP interactions. HTTPie excels in readability and ease of use for API testing and development, while curl offers more flexibility for complex networking tasks across multiple protocols.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

HTTPie
HTTPie CLI: human-friendly HTTP client for the API era

HTTPie for Desktop Twitter Chat

Docs Latest version Build Coverage PyPi downloads

HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs & HTTP servers. The http & https commands allow for creating and sending arbitrary HTTP requests. They use simple and natural syntax and provide formatted and colorized output.

HTTPie in action

We lost 54k GitHub stars

Please note we recently accidentally made this repo private for a moment, and GitHub deleted our community that took a decade to build. Read the full story here: https://httpie.io/blog/stardust

Getting started

Features

  • Expressive and intuitive syntax
  • Formatted and colorized terminal output
  • Built-in JSON support
  • Forms and file uploads
  • HTTPS, proxies, and authentication
  • Arbitrary request data
  • Custom headers
  • Persistent sessions
  • wget-like downloads

See all features →

Examples

Hello World:

https httpie.io/hello

Custom HTTP method, HTTP headers and JSON data:

http PUT pie.dev/put X-API-Token:123 name=John

Build and print a request without sending it using offline mode:

http --offline pie.dev/post hello=offline

Use GitHub API to post a comment on an Issue with authentication:

http -a USERNAME POST https://api.github.com/repos/httpie/cli/issues/83/comments body='HTTPie is awesome! :heart:'

See more examples →

Community & support

Contributing

Have a look through existing Issues and Pull Requests that you could help with. If you'd like to request a feature or report a bug, please create a GitHub Issue using one of the templates provided.

See contribution guide →