• home
  • about
  • 全ての投稿
  • ソフトウェア・ハードウェアの設定のまとめ
  • 分析関連のまとめ
  • ヘルスケア関連のまとめ
  • 生涯学習関連のまとめ

httpx

date: 2021-08-02 excerpt: httpxの使い方

tag: httpxpython


httpxとは

  • async対応のrequests
  • interfaceがrequestsと似ている
  • requestsのバグを踏んだときやasyncで動かしたいときなどが適応例

同期モードの使用例

proxies = {"https://": "http://USERNAME:PASSWORD@" + random.choice(L)}
with httpx.Client(proxies=proxies) as client:
    r = client.get(url, headers=headers, allow_redirects=False, timeout=10.0)
    html = r.text


httpxpython Share Tweet