Skip to main content

在启动了Clash的情况下,requests发送请求会报错,于是稍微封装了下

Project description

requestspr

PyPI PyPI - License

在启动了Clash的情况下,requests发送请求会报错,于是稍微封装了下

Install

pip install requestspr

Example

import requestspr as requests


def google_search(text: str):
    """谷歌搜索"""
    return requests.get(f'https://www.google.com/search?q={text}')


if __name__ == '__main__':
    # 默认使用系统代理, 请求成功
    print(google_search('test'))

    # 不使用系统代理,请求失败
    # requests.set_proxy_mode(requests.ProxyMode.NoProxy)
    # print(google_search('test'))

    # 自行设置代理
    # requests.set_proxy_mode(requests.ProxyMode.Static, {'https': '127.0.0.1:7890'})
    # print(google_search('test'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requestspr-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requestspr-0.0.2-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file requestspr-0.0.2.tar.gz.

File metadata

  • Download URL: requestspr-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for requestspr-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7c74b0fdc154c2a3b1f47e4fe31e23fdc912bde4378b983625871e8450f8adf4
MD5 ae0674c609e75fc5427c4db67762d298
BLAKE2b-256 931c0b38f55553ba08242bdca4cf2f3c864ba27f5259a107998b4f9a3eb3107b

See more details on using hashes here.

File details

Details for the file requestspr-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: requestspr-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for requestspr-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7b98931fdc81d7534b9d5db83369c180b01f050d207eeb03a808c46113eeea35
MD5 ea42b503c192669e1fa509e3f3d0ded9
BLAKE2b-256 3d9a14ae3db2f2be69a1e6bb43de2a321014a8bea29b187926fbd201fae53f18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page