HTTPClient

BentoML · integration, http-client, async-http, client-sdk, dev-tools

Async HTTP client for BentoML services, handling requests and responses.

from __future__ import annotations

import asyncio
import json
import logging
import time
import typing as t
from functools import cached_property

import httpx
import starlette.datastructures
import starlette.requests

from ...exceptions import BentoMLException
from ...exceptions import RemoteException
from .. import io_descriptors as io
from ..service import Service
from ..service.inference_api import InferenceAPI
from . import AsyncClient
from . import Client
from . import SyncClient

logger = logging.getLogger(__name__)


class HTTPClient(Client):
    def __init__(self, svc: Service, server_url: str):
        self._sync_client = SyncHTTPClient(svc=svc, server_url=server_url)
        self._async_client = AsyncHTTPClient(svc=svc, server_url=server_url)
        super().__init__(svc, serve

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key