def json_post():
# response = requests.post(build_uri("user/emails"), auth=("[email protected]", "XXXXXXXXXX"),
# json=["[email protected]"])
response = requests.delete(build_uri("user/emails"),
auth=("[email protected]", "XXXXXXXXXX"),
json=["[email protected]"])
print better_print(response.text)
print response.request.headers
print response.request.body
print response.status_code, response.reason
def json_post():
response = requests.post(build_uri("user/emails"), auth=("[email protected]", "XXXXXXXXXX"),
json=["[email protected]"])
# response = requests.delete(build_uri("user/emails"),
# auth=("[email protected]", "XXXXXXXXXX"),
# json=["[email protected]"])
print better_print(response.text)
print response.request.headers
print response.request.body
print response.status_code, response.reason
201 Created
我首先使用第二段代码在github账号下,添加了一个邮箱[email protected]
从运行的结果可以看出,邮箱成功的添加到账号下,status_code 是201,即已经创建
然后我使用第一段代码去删除这个新添加的邮箱,但是却显示404 not found
我自己的查看了API的文档,目前没有找出什么原因,故记录在此,也希望有缘人看到了能给一些建议;