HTTP Client extension for Flask
Project description
flask_httpclient帮助文档
简介
对 requests 库进行包装,需要在 Flask 配置文件或对象创建时配置以下参数:
- 请求URL: {config_prefix}_URL/base_url
- 请求超时:{config_prefix}_TIMEOUT/timeout
- 实例前缀:config_prefix
- 重试次数:retry
安装
pip install flask-httpclient
使用
from flask_httpclient import HTTPClient
http_client = HTTPClient(base_url='xxx',timeout=1, config_prefix='OPEN_API')
# 创建 Flask 应用时集成扩展
def create_app():
app = Flask(__name__)
http_client.init_app(app)
# app 中使用
resp = http_client.get('/users', params=params)
License
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
Flask-HTTPClient-1.1.tar.gz
(3.1 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 Flask-HTTPClient-1.1.tar.gz.
File metadata
- Download URL: Flask-HTTPClient-1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c98ff76587f4eb368ba7308b7e3d13d1cc464cc4941babe67be1e04928099cca
|
|
| MD5 |
8a6c518050f7d45f520271421777400b
|
|
| BLAKE2b-256 |
534f7d9a629dca95b5cf0174cd5a80f4283bb39df11bfc0b3d5a3b6f674f5c17
|
File details
Details for the file Flask_HTTPClient-1.1-py3-none-any.whl.
File metadata
- Download URL: Flask_HTTPClient-1.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
123c7cc70d73d79806c27608644e0ead3b7ef40f6e1076354e5990446c7e8a86
|
|
| MD5 |
ef78922b27faea1710833c4d92a1f6b8
|
|
| BLAKE2b-256 |
b67cffaf1ce89a98db041f620a7898a73fb18dc48c71eef8ce301088cf70f4bf
|