GET Request:
1. Get request (no parameters):
2. Get request (with parameters):
Interface Address: HTTP://JAPI.JUHE.CN/QQEVALUATE/QQ
Return format: JSON
Request method: Get Post
Sample request: Http://japi.juhe.cn/qqevaluate/qq?key= the appkey&qq=295424589 you requested
Interface Note: According to the parameters of the QQ number and the AppKey you applied to test QQ inauspiciousness
Request parameter description (enter parameter):
Name Required type description
Key is the string you requested for the APPKEY:8DBEE1FCD8627FB6699BCE7B986ADC45
QQ is the string needs to test QQ number: 907728701
2.1, the URL of the way to pass the parameter:
url = ' http://japi.juhe.cn/qqevaluate/qq?key= 8dbee1fcd8627fb6699bce7b986adc45&qq=907728701 '
2.2, in the form of a dictionary to pass the parameter:
url = ' HTTP://JAPI.JUHE.CN/QQEVALUATE/QQ '
Par = {
' Key ': ' 8dbee1fcd8627fb6699bce7b986adc45 ',
' QQ ': ' 907728701 '
}
R = Requests.get (Url,params=par) #发送get请求
POST request:
1. Post request (no parameters):
url = ' HTTP://JAPI.JUHE.CN/QQEVALUATE/QQ '
r = Requests.post (URL) #发送post请求
Print (R.status_code) #打印状态码
Print (r.headers) #打印返回的报头 (head)
Print (R.text) #查看返回结果的文本形式 (body part)
2. Post request (with parameters):
2.1, the URL of the way to pass the parameter:
url = ' http://japi.juhe.cn/qqevaluate/qq?key= 8dbee1fcd8627fb6699bce7b986adc45&qq=907728701 '
r = Requests.post (URL) #发送post请求
2.2, in the form of a dictionary to pass the parameter:
url = ' HTTP://JAPI.JUHE.CN/QQEVALUATE/QQ '
Par = {
' Key ': ' 8dbee1fcd8627fb6699bce7b986adc45 ',
' QQ ': ' 907728701 '
}
R = Requests.post (Url,params=par) #发送get请求
Python Interface Automation test three: code to send HTTP requests