diff options
Diffstat (limited to 'g4f/requests/aiohttp.py')
-rw-r--r-- | g4f/requests/aiohttp.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/g4f/requests/aiohttp.py b/g4f/requests/aiohttp.py index 6979b20a..505086a1 100644 --- a/g4f/requests/aiohttp.py +++ b/g4f/requests/aiohttp.py @@ -1,6 +1,6 @@ from __future__ import annotations -from aiohttp import ClientSession, ClientResponse, ClientTimeout, BaseConnector +from aiohttp import ClientSession, ClientResponse, ClientTimeout, BaseConnector, FormData from typing import AsyncIterator, Any, Optional from .defaults import DEFAULT_HEADERS @@ -43,4 +43,8 @@ def get_connector(connector: BaseConnector = None, proxy: str = None, rdns: bool connector = ProxyConnector.from_url(proxy, rdns=rdns) except ImportError: raise MissingRequirementsError('Install "aiohttp_socks" package for proxy support') - return connector
\ No newline at end of file + return connector + +class CurlMime(FormData): + def addpart(self, name: str, content_type: str = None, filename: str = None, data: bytes = None): + self.add_field(name, data, content_type=content_type, filename=filename)
\ No newline at end of file |