Skip to content
Myr

Drop prepare_request

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent 1970912 · Browse files · 3 files+2 added−19 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+2 added−19 removed

  • other:+2 added−19 removed

3 files+2 added−19 removed

modified:httpcore/client.py-8 removed
295 unmodified lines
296 params=params,297 headers=headers,298 cookies=self.merge_cookies(cookies),299 )300 self.prepare_request(request)300 response = await self.send(301 request,302 stream=stream,303 auth=auth,
3 unmodified lines
307 timeout=timeout,308 )309 return response310312 def prepare_request(self, request: Request) -> None:313 request.prepare()314311 def merge_cookies(312 self, cookies: CookieTypes = None313 ) -> typing.Optional[CookieTypes]:314 if cookies or self.cookies:
229 unmodified lines
544 params=params,545 headers=headers,546 cookies=self._client.merge_cookies(cookies),547 )552 self.prepare_request(request)548 response = self.send(549 request,550 stream=stream,551 auth=auth,
208 unmodified lines
760 cert=cert,761 timeout=timeout,762 )763769 def prepare_request(self, request: Request) -> None:770 self._client.prepare_request(request)771764 def send(765 self,766 request: Request,767 *,
33 unmodified lines
modified:httpcore/interfaces.py-4 removed
42 unmodified lines
43 cert: CertTypes = None,44 timeout: TimeoutTypes = None45 ) -> Response:46 request = Request(method, url, data=data, params=params, headers=headers)47 self.prepare_request(request)47 response = await self.send(48 request, stream=stream, verify=verify, cert=cert, timeout=timeout49 )50 return response5153 def prepare_request(self, request: Request) -> None:54 request.prepare()5552 async def send(53 self,54 request: Request,55 stream: bool = False,
75 unmodified lines
modified:httpcore/models.py+2 added-7 removed
501 unmodified lines
502 else:503 self.is_streaming = True504 self.content_aiter = data505506 self.prepare()507508 async def read(self) -> bytes:509 """510 Read and return the response content.511 """
8 unmodified lines
520 elif self.content:521 yield self.content522523 def prepare(self) -> None:522 """523 Adds in any default headers. When using the `Client`, this will524 end up being called into by the `prepare_request()` stage.525526 You can omit this behavior by calling `Client.send()` with an527 explicitly built `Request` instance.528 """524 auto_headers = [] # type: typing.List[typing.Tuple[bytes, bytes]]525526 has_host = "host" in self.headers527 has_content_length = (
504 unmodified lines