Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Make http requests to json apis

Project description

Papir is an acronym for “Python API Requests”.

The main purpose is to make custom http requests to json APIs, prettify and colorize the full response (headers + json content).

Json files are used to post, put, patch or delete and to customize the http headers.

Basic http authentication is supported.

Simple example:

$ papir


  • Works on Python3.3+
  • Uses only Python standard library for maximum compatibility
  • Small and simple source code that can be read in a few minutes


Install using pip:

pip install papir


Download and set executable permission on the script file:

chmod +x


Download and run using the python interpreter:



Usage: papir url [options] [method]

make http requests to json apis

--version        show program's version number and exit
-d DATA_FILE     json file to post, put, patch or delete
-h HEADERS_FILE  json file containing additional headers
-t TIMEOUT       timeout in seconds to wait for response (default: 10)
-a AUTH          basic http authentication in the format username:password
-f, --follow     follow redirects (default: disabled)
-v, --verbose    show request headers (default: disabled)


Assuming the file “data.json” exists containing:

    "name": "Bob",
    "age": 30

Make a post request using that data:

$ papir -d data.json

To use a different http method just inform it:

$ papir -d data.json put

To customize the request headers, create a json file like:

    "Auth-User": "user",
    "Auth-Token": "1234",
    "User-Agent": "myagent"

And add it to the request:

$ papir -h headers.json

Obviously, you can mix it with all kinds of http methods:

$ papir -h headers.json -d data.json patch

Simple basic auth:

$ papir -a user:pass

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for papir, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size papir-0.1.1.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page