Skip to content

yamitzky/req

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

req

Single file alternative to python-requests

Motivation

requests is an awesome Python library to make HTTP requests.

Unfortunately, pip install-ing is difficult in a serverless environment such as AWS Lambda.

req is a minimum(broken) port of requests, written in single python file, and it has no dependency. It is incredibly easy to use, all you have to do is coping the file.

Installation

Copy req.py.

Usage

Very similar to requests.

import req

res = req.get('http://httpbin.org/headers', headers={'Some': 'Header'})
print(res.json())

Limitation

  • Only UTF-8 encoding is supported
  • No support for some arguments: 'cookies', 'files', 'auth', 'proxies', 'verify', 'stream', 'cert'
  • No support for some properties of response
  • Not tested well

About

Single file alternative to python-requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages