在启动了Clash的情况下,requests发送请求会报错,于是稍微封装了下
Project description
requestspr
在启动了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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c74b0fdc154c2a3b1f47e4fe31e23fdc912bde4378b983625871e8450f8adf4
|
|
| MD5 |
ae0674c609e75fc5427c4db67762d298
|
|
| BLAKE2b-256 |
931c0b38f55553ba08242bdca4cf2f3c864ba27f5259a107998b4f9a3eb3107b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b98931fdc81d7534b9d5db83369c180b01f050d207eeb03a808c46113eeea35
|
|
| MD5 |
ea42b503c192669e1fa509e3f3d0ded9
|
|
| BLAKE2b-256 |
3d9a14ae3db2f2be69a1e6bb43de2a321014a8bea29b187926fbd201fae53f18
|