github api delete URL=.../user/emails 不成功啊
有谁尝试使用delete吗,我做过实验,总是不成功啊,老师有试试吗?
有谁尝试使用delete吗,我做过实验,总是不成功啊,老师有试试吗?
2017-10-01
Python 3.6.2 下的代码供参考
def request_get(): response = requests.get(build_uri('user/emails'), auth=('imoocdemo', 'imoocdemo123')) print(better_print(response.text)) print(response.request.headers) print(response.status_code) def request_method(): response = requests.delete(build_uri('user/emails'), auth=('imoocdemo', 'imoocdemo123'), json=['hell@imoc.org']) print(better_print(response.text)) print(response.request.headers) print(response.request.body) print(response.status_code) if __name__ == '__main__': request_method() request_get()
先只运行 request_get() 获取邮箱地址列表,把最后一个邮箱地址替换到 request_method() 的 json 里,再运行 request_method() 和 request_get() 查看结果
举报