DEV Community

Lam
Lam

Posted on

1 1

Httpie Cheat Sheet

References

Options

Printing options

-v, --verbose            # same as --print=HhBb --all
-h, --headers            # same as --print=h
-b, --body               # same as --print=b
    --all                # print intermediate requests
    --print=HhBb         # H: request headers
                         # B: request body
                         # h: response headers
                         # b: response body
    --pretty=none        # all | colors | format
    --json | -j          # Response is serialized as a JSON object.
Enter fullscreen mode Exit fullscreen mode

Authentication

    --session NAME
-a, --auth USER:PASS
    --auth-type basic
    --auth-type digest
Enter fullscreen mode Exit fullscreen mode

Session

    --session NAME       # store auth and cookies
    --session-read-only NAME
Enter fullscreen mode Exit fullscreen mode

Downloading

-d, --download           # like wget
-c, --continue
-o, --output FILE
Enter fullscreen mode Exit fullscreen mode

Others

-F, --follow             # follow redirects
    --max-redirects N    # maximum for --follow
    --timeout SECONDS
    --verify no          # skip SSL verification
    --proxy http:http://foo.bar:3128
Enter fullscreen mode Exit fullscreen mode

Raw JSON

$ echo '{"hello": "world"}' | http POST example.com/post
Enter fullscreen mode Exit fullscreen mode

Forms

$ http --form POST example.com \
    name="John Smith" \
    cv=@document.txt
Enter fullscreen mode Exit fullscreen mode

Parameters

$ http POST http://example.com/posts/3 \
    Origin:example.com \  # :   HTTP headers
    name="John Doe" \     # =   string
    q=="search" \         # ==  URL parameters (?q=search)
    age:=29 \             # :=  for non-strings
    list:='[1,3,4]' \     # :=  json
    file@file.bin \       # @   attach file
    token=@token.txt \    # =@  read from file (text)
    user:=@user.json      # :=@ read from file (json)
Enter fullscreen mode Exit fullscreen mode

Introduction

HTTPie is a command-line HTTP client.

Top comments (0)

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay