标签:python3 stat 下载 wan and content route org lang
usage:
>>> import requests
>>> r = requests.get(‘https://www.python.org‘)
>>> r.status_code
200
>>> ‘Python is a programming language‘ in r.content
True
... or POST:
>>> payload = dict(key1=‘value1‘, key2=‘value2‘)
>>> r = requests.post(‘https://httpbin.org/post‘, data=payload)
>>> print(r.text)
{
...
"form": {
"key2": "value2",
"key1": "value1"
},
...
}
#coding=utf-8
import requests
import json
from flask import Flask
app = Flask(__name__)
@app.route("/")
def logine():
data = json.dump(
{
‘username‘: "aa",
‘password‘: "111111"
}
)
return data
if __name__ == "__main__":
app.run()
标签:python3 stat 下载 wan and content route org lang
原文地址:https://www.cnblogs.com/LinxiHuang/p/13191086.html