From 18c7ba277c8a7356cc3168c83a70a7ba9725d112 Mon Sep 17 00:00:00 2001 From: AJ Steers <4809760-aaronsteers@users.noreply.gitlab.com> Date: Thu, 1 Apr 2021 01:14:21 +0000 Subject: [PATCH] prepare request from session context --- singer_sdk/streams/rest.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/singer_sdk/streams/rest.py b/singer_sdk/streams/rest.py index 8c90b475a..fb1dade9d 100644 --- a/singer_sdk/streams/rest.py +++ b/singer_sdk/streams/rest.py @@ -124,13 +124,15 @@ def prepare_request( url: str = self.get_url(partition) params: dict = self.get_url_params(partition, next_page_token) request_data = self.prepare_request_payload(partition, next_page_token) - request = requests.Request( - method=http_method, - url=url, - params=params, - headers=self.authenticator.http_headers, - json=request_data, - ).prepare() + request = self.requests_session.prepare_request( + requests.Request( + method=http_method, + url=url, + params=params, + headers=self.authenticator.http_headers, + json=request_data, + ) + ) return request def request_records(self, partition: Optional[dict]) -> Iterable[dict]: