---
title: HTTPie
kind: note
description: curl alternative with syntax optimized for API requests
words: 151
readingMinutes: 1
created: '2026-04-03T00:00:00.000Z'
updated: '2026-04-03T21:12:10+02:00'
website: https://httpie.io/
---
## Link

<https://httpie.io/>

# Resources
- [Docs](https://httpie.io/docs/cli)
## Videos
- Intro tutorial
  

<div class="youtube-embed"><iframe src="https://www.youtube-nocookie.com/embed/sHB6ONj_KMw" title="Do not use curl, use httpie 🥧 - YouTube" loading="lazy" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>


# FAQ
## Simple GET example
```shell
http DOMAIN/PATH
```
## Use HTTPS
```shell
https DOMAIN/PATH
```
## `localhost` is the default domain
```shell
http :8000 # GET http://localhost:8000
```
## Using other methods
```shell
http POST :8000 # or PUT, PATCH, etc.
```
## Simple <span class="dead-link">JSON</span> POST
```shell
http :8000 color=red food=pizza
```
The above POSTs a simple object to http://localhost:8000/:
```json
{
  "color": "red",
  "food": "pizza"
}
```
The `POST` method was emitted, as it is the default when providing payload variable(s).
Note: The whitespace in the JSON above is for readability, HTTPie would not usually include unnecessary spaces or line breaks.
## <span class="dead-link">JSON</span> property that is not a string
```shell
http ... age:=44 learning:=true name=Claus
```
The above sends this object:
```json
{
  "age": 44,
  "learning": true,
  "name": "Claus"
}
```
## Show request (headers/body)
```shell
http -v ...
```
## Query parameters
```shell
http ... param1==2 param2==5 # ...?param1=2&param2=5
```
## Dry-run (show request that would be sent)
```shell
http --offline ...
```
## Set request header
 ```shell
 http ... X-My-Custom-Header:my-value
 ```
## POST form data (`application/x-www-form-urlencoded`)
```shell
http -f ... param1=value param2="another value"...
# or
http --form ... param1=value param2="another value" ...
```
## Basic auth
```shell
http -a USERNAME:PASSWORD ...
```
## Remove default `User-Agent` header
```shell
http ... User-Agent: ...
```
## Build a more complex <span class="dead-link">JSON</span> object
```shell
http ... category=tools search[type]=id search[id]:=1
```
...results in this object being sent:
```json
{
    "category": "tools",
    "search": {
        "id": 1,
        "type": "id"
    }
}
```
## Append to a <span class="dead-link">JSON</span> array
```shell
http ... \
  search[keywords][]=APIs \
  search[keywords][]=CLI
```
...results in this object being sent:
```json
{
    "search": {
        "keywords": [
            "APIs",
            "CLI"
        ]
    }
}
```
## Send a <span class="dead-link">JSON</span> array
Omit the key:
```shell
http ... []:=1 []:=2
```
...results in this array being sent:
```json
[
    1,
    2
]
```
## Escape character
`\` escapes `[`, `]` and `\`
## Send file contents as raw request body
```shell
http ... < data/file.json
```
## Upload a file using `multipart/form-data`
```shell
http --form ... application@/home/claus/Desktop/resume.pdf
```
## Use `Bearer` authorization
```shell
http -A bearer -a TOKEN ...
```
Note: despite `bearer` requiring a lowercase `b` in the `-A` argument, the sent header *will* bear a capitalized `Bearer`.
## Follow redirects (`Location` response header)
```shell
http --follow ...
```
## Do not verify host certificate (insecure)
```shell
https --verify=no ...
```
## Output only response
```shell
http -b ...
# or
http --body ...
```
## Send clipboard ([macOS](/notes/macos))
```shell
pbpaste | http ...
```
