示例相应的接口文档:https://developer.github.com/v3/users/emails/

 

requests库学习--post请求

python代码:

import requests

test_url = 'https://api.github.com'


def get_url(url):
    return '/'.join([test_url, url])


email = ['[email protected]', '[email protected]']


def add_email():
    r = requests.post(get_url('user/emails'), json=email, auth=('[email protected]', 'zhj19931015'))
    print(r.status_code)
    print(r.text)
    print(r.request.headers)


add_email()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2021-07-09
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-11-08
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案