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.1.tar.gz (3.2 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.1-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: requestspr-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 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.1.tar.gz
Algorithm Hash digest
SHA256 31d7fd0187390f4b73f005148167a7c838a30fa65acb7a8ee0a0f05aae5cf878
MD5 f6ab7df11cb3413553b91b5da417e41f
BLAKE2b-256 c2a46d00feddd723c4a0fae80fdd7be9a26c2e3c5389fb152f2ad3a2f7df2f74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: requestspr-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7c3308a3b13950699e5c76ee1bdf28c27860056af3f0dd0ae6dce8b032cacdca
MD5 9f93b8d307c50c00187c8e58f030baa3
BLAKE2b-256 c8c5f4afc78e724b7079c90183c20d0820536ecf29f9e57d753bdddb12fd66c0

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