Format: application/x-python-code
⬇ Download File (3.3 KB)
   1  o
   2  
   3  C'h�	�@stddlmZddlZddlmZddlmZmZejddd�Z	ejd	d
   4  d�Z
   5  d
   6  dgZGdd�d�ZGdd
   7  �d
   8  �Z
   9  dS)
  10  �)�annotationsN)�
  11  TracebackType�)�Request�Response�T�
  12  BaseTransport)�bound�A�AsyncBaseTransportc@�<eZdZddd�Z			dddd�Zddd�Zddd�ZdS)r�selfr�returncCs|S�N��r
  13  rr�LC:\Users\shubh\Videos\agent\nova\Lib\site-packages\httpx/_transports/base.py�	__enter__�zBaseTransport.__enter__N�exc_type�type[BaseException] | None�	exc_value�BaseException | None�	traceback�TracebackType | None�NonecCs|��dSr)�close�r
  14  rrrrrr�__exit__szBaseTransport.__exit__�requestrrcCstd��)aT
  15          Send a single HTTP request and return a response.
  16  
  17          Developers shouldn't typically ever need to call into this API directly,
  18          since the Client class provides all the higher level user-facing API
  19          niceties.
  20  
  21          In order to properly release any network resources, the response
  22          stream should *either* be consumed immediately, with a call to
  23          `response.stream.read()`, or else the `handle_request` call should
  24          be followed with a try/finally block to ensuring the stream is
  25          always closed.
  26  
  27          Example usage:
  28  
  29              with httpx.HTTPTransport() as transport:
  30                  req = httpx.Request(
  31                      method=b"GET",
  32                      url=(b"https", b"www.example.com", 443, b"/"),
  33                      headers=[(b"Host", b"www.example.com")],
  34                  )
  35                  resp = transport.handle_request(req)
  36                  body = resp.stream.read()
  37                  print(resp.status_code, resp.headers, body)
  38  
  39  
  40          Takes a `Request` instance as the only argument.
  41  
  42          Returns a `Response` instance.
  43          z0The 'handle_request' method must be implemented.��NotImplementedError�r
  44  rrrr�handle_requests�zBaseTransport.handle_requestcCsdSrrrrrrr=rzBaseTransport.close)r
  45  rrr�NNN�rrrrrrrr�rrrr�rr)�__name__�
  46  __module__�__qualname__rrr#rrrrrrs
  47  �
  48  #c@r)rr
  49  r
  50  rc�s�|Srrrrrr�
  51  __aenter__B��zAsyncBaseTransport.__aenter__Nrrrrrrrc�s�|��IdHdSr)�acloserrrr�	__aexit__Es�zAsyncBaseTransport.__aexit__rrrc�s
  52  �td��)Nz6The 'handle_async_request' method must be implemented.r r"rrr�handle_async_requestMs��z'AsyncBaseTransport.handle_async_requestc�s�dSrrrrrrr-Ur,zAsyncBaseTransport.aclose)r
  53  r
  54  rr
  55  r$r%r&r')r(r)r*r+r.r/r-rrrrrAs
  56  �
  57  )�
  58  __future__r�typing�typesrZ_modelsrr�TypeVarrr
  59  �__all__rrrrrr�<module>s3