http请求的pythonic方式
pyrequest的Python项目详细描述
##pyhttp
python的http包装非常简单。
[![构建状态](https://travis-ci.org/plasmashadow/pyhttp.svg?branch=master)(https://travis ci.org/plasmashadow/pyhttp)
[![PYPI版本](https://badge.fury.io/py/pyrequest.svg)(http://badge.fury.io/py/pyrequest)
[![pypi](https://img.shields.io/pypi/dm/pyrequest.svg)(https://pypi.python.org/pypi/pyrequest)
[![代码运行状况](https://landscape.io/github/plasmashadow/pyhttp/master/landscape.svg?(https://landscape.io/github/plasmashadadow/pyhttp/master/pyhttp/pyhttp/master)
`` ` ` `
` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
r/>请求后=请求('http://jsonplaceholder.typicode.com/posts')
response=r.post({'title':'hello'})
打印响应。content
打印响应。status
打印响应。json
/设置头
r=request('http://jsonplaceholder.typicode.com/posts')
r.headers={'content-type':'application/json')
响应=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
/删除请求
=请求('http://jsonplaceholder.typicode.com/posts/1')
r.delete()
````
\license
https svg io master http response 方式 pythonic pyhttp
python的http包装非常简单。
[![构建状态](https://travis-ci.org/plasmashadow/pyhttp.svg?branch=master)(https://travis ci.org/plasmashadow/pyhttp)
[![PYPI版本](https://badge.fury.io/py/pyrequest.svg)(http://badge.fury.io/py/pyrequest)
[![pypi](https://img.shields.io/pypi/dm/pyrequest.svg)(https://pypi.python.org/pypi/pyrequest)
[![代码运行状况](https://landscape.io/github/plasmashadow/pyhttp/master/landscape.svg?(https://landscape.io/github/plasmashadadow/pyhttp/master/pyhttp/pyhttp/master)
`` ` ` `
` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
r/>请求后=请求('http://jsonplaceholder.typicode.com/posts')
response=r.post({'title':'hello'})
打印响应。content
打印响应。status
打印响应。json
/设置头
r=request('http://jsonplaceholder.typicode.com/posts')
r.headers={'content-type':'application/json')
响应=r.post({'title':'hello'})
print response.content
print response.status
print response.json
//put request
response=r.put({'title':'hello'})
print response.content
print response.status
print response.json
/删除请求
=请求('http://jsonplaceholder.typicode.com/posts/1')
r.delete()
````
\license
标签: