Skip to main content

对 FastApi 进行二次封装的简易 HTTP Web 服务 SDK

Project description

AmiyaHttp

PyPI

FastAPI 进行二次封装的简易 HTTP Web 服务 SDK

文档地址:点击查看

import asyncio
from pydantic import BaseModel
from amiyahttp import HttpServer


# 定义 POST 请求参数
class UserModel(BaseModel):
    username: str
    nickname: str


server = HttpServer(host='0.0.0.0', port=8088)


@server.controller
class Bot:
    @server.route(method='get')
    async def get_name(self):
        return 'AmiyaBot'

    @server.route(method='post')
    async def say_hello(self, params: UserModel):
        return server.response(message=f'hello, {params.nickname}')


asyncio.run(server.serve())

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

amiyahttp-0.0.7-277-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file amiyahttp-0.0.7-277-py3-none-any.whl.

File metadata

  • Download URL: amiyahttp-0.0.7-277-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for amiyahttp-0.0.7-277-py3-none-any.whl
Algorithm Hash digest
SHA256 8620763192df867ebe02ff243be9ffdd042f78e3be597aaf56eb9ffa3112b12b
MD5 50af339a5b1eaca0d82922f58fccbdc8
BLAKE2b-256 174dd71bab6a5f0e86b4473b57863e9e8f5b692377f7f4d2f45a898c0cc16e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for amiyahttp-0.0.7-277-py3-none-any.whl:

Publisher: pypi.yml on AmiyaBot/Amiya-HTTP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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