requests库不能发送http2请求,这里使用hyper库
参考官方文档:hyper.readthedocs.io/en/latest/a…

from hyper import tls,HTTP20Connection
c=HTTP20Connection("mgr.ajcloud.net:443",secure=True,ssl_context = tls.init_context(cert_path='D://my_project//ca.crt',cert=('D://my_project//mgr.crt', 'D://my_project//mgr.key')))#cert_path为服务端证书,cert客户端证书
response = c.request('GET', "/api/v1/xxxxxxx")#你的请求URL
resp = c.get_response(response)
print(resp.read())