Skip to main content

No project description provided

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot_plugin_requests

✨ 封装 ForwardDriver 实现 HttpClient 功能 ✨

📖 介绍

本插件提供了 HttpClient 的封装, 简化了网络请求调用

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-requests
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-requests
pdm
pdm add nonebot-plugin-requests
poetry
poetry add nonebot-plugin-requests
conda
conda install nonebot-plugin-requests

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_example"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的配置

配置项 必填 默认值 说明
nonebot_plugin_requests_enable_proxy False 是否使用代理
nonebot_plugin_requests_proxy_type http 代理类型(仅限http)
nonebot_plugin_requests_proxy_address 127.0.0.1 代理地址
nonebot_plugin_requests_proxy_port 1081 代理端口

🎉 使用

参考示例如下:

import nonebot

nonebot.require("nonebot_plugin_requests")

from nonebot_plugin_requests import NonebotRequests


async def get_something():
    request = NonebotRequests()
    response = await request.get(...)

    json = NonebotRequests.parse_content_json(response)
    text = NonebotRequests.parse_content_text(response)
    ...

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

nonebot_plugin_requests-0.1.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_requests-0.1.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_requests-0.1.2.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_requests-0.1.2.tar.gz
Algorithm Hash digest
SHA256 23495a3b4b9898fba01b39a2a193dd95d6f3b50cd0a62debb1cc90f4fec3ca04
MD5 0e9262ed9bd3bacbb1eef77d952182f3
BLAKE2b-256 71b8f8cc3938f281a5cdc964dc929bb13e95101bd101ec12f37566c347d16e09

See more details on using hashes here.

File details

Details for the file nonebot_plugin_requests-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_requests-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81224291350a7138c245bee6ea02a60c764bdee88e58993782de836846ee717c
MD5 838a252119ab23c37b9b25b556fc23a1
BLAKE2b-256 ebcc05ada2aaf4ddd4d61f2d77b4feb38b7940f348192504a8ef9225542ea934

See more details on using hashes here.

Supported by

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