langchain.utilities.requests.Requests¶
- class langchain.utilities.requests.Requests(*, headers: Optional[Dict[str, str]] = None, aiosession: Optional[ClientSession] = None, auth: Optional[Any] = None)[source]¶
Bases:
BaseModelWrapper around requests to handle auth and async.
The main purpose of this wrapper is to handle authentication (by saving headers) and enable easy async methods on the same base object.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param aiosession: Optional[aiohttp.client.ClientSession] = None¶
- param auth: Optional[Any] = None¶
- param headers: Optional[Dict[str, str]] = None¶
- adelete(url: str, **kwargs: Any) AsyncGenerator[ClientResponse, None][source]¶
DELETE the URL and return the text asynchronously.
- aget(url: str, **kwargs: Any) AsyncGenerator[ClientResponse, None][source]¶
GET the URL and return the text asynchronously.
- apatch(url: str, data: Dict[str, Any], **kwargs: Any) AsyncGenerator[ClientResponse, None][source]¶
PATCH the URL and return the text asynchronously.
- apost(url: str, data: Dict[str, Any], **kwargs: Any) AsyncGenerator[ClientResponse, None][source]¶
POST to the URL and return the text asynchronously.
- aput(url: str, data: Dict[str, Any], **kwargs: Any) AsyncGenerator[ClientResponse, None][source]¶
PUT the URL and return the text asynchronously.
- patch(url: str, data: Dict[str, Any], **kwargs: Any) Response[source]¶
PATCH the URL and return the text.
- post(url: str, data: Dict[str, Any], **kwargs: Any) Response[source]¶
POST to the URL and return the text.