https://github.com/sourcepirate/pyhttp
Very Minimal Http Library for python
https://github.com/sourcepirate/pyhttp
Last synced: 23 days ago
JSON representation
Very Minimal Http Library for python
- Host: GitHub
- URL: https://github.com/sourcepirate/pyhttp
- Owner: sourcepirate
- Created: 2015-06-02T02:27:17.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-03T17:28:53.000Z (about 11 years ago)
- Last Synced: 2026-02-21T07:05:57.536Z (4 months ago)
- Language: Python
- Size: 133 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##PyHTTP
Very Minimal HTTP wrapper for Python.
[](https://travis-ci.org/plasmashadow/pyhttp)
[](http://badge.fury.io/py/pyrequest)
[](https://pypi.python.org/pypi/pyrequest)
[](https://landscape.io/github/plasmashadow/pyhttp/master)
##installation
```
pip install pyrequest
```
##Usage
```python
from pyhttp import Request
r = Request("google.com").get()
print r.status
//POST request
r = Request('http://jsonplaceholder.typicode.com/posts')
response = r.post({'title': 'hello'})
print response.content
print response.status
print response.json
//setting headers
r = Request('http://jsonplaceholder.typicode.com/posts')
r.headers = {'content-type': 'application/json')
response = r.post({'title': 'hello'})
print response.content
print response.status
print response.json
//PUT request
r = Request('http://jsonplaceholder.typicode.com/posts/1')
response = r.put({'title': 'hello'})
print response.content
print response.status
print response.json
//DELETE request
r = Request('http://jsonplaceholder.typicode.com/posts/1')
r.delete()
```
##License
MIT