From 305cefba441f41df5b79c3b8484974dd05121509 Mon Sep 17 00:00:00 2001 From: alexey Date: Fri, 27 Dec 2024 13:15:02 +0300 Subject: [PATCH 1/2] fix urlencoding qs for api_request --- hubspot/utils/requests/http_request_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hubspot/utils/requests/http_request_builder.py b/hubspot/utils/requests/http_request_builder.py index 047674bc..c970909c 100644 --- a/hubspot/utils/requests/http_request_builder.py +++ b/hubspot/utils/requests/http_request_builder.py @@ -67,7 +67,7 @@ def generate_url(self) -> str: qs = self.options.get("qs") if qs: - query_string = urlencode(qs) + query_string = urlencode(qs, doseq=True) url += f"?{query_string}" return url From 8053d574c3d8f0802fdb1c4e769f2ad2fd82b2d7 Mon Sep 17 00:00:00 2001 From: alexey Date: Mon, 13 Jan 2025 10:09:27 +0300 Subject: [PATCH 2/2] enhance generate_url --- hubspot/utils/requests/http_request_builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hubspot/utils/requests/http_request_builder.py b/hubspot/utils/requests/http_request_builder.py index c970909c..fc3a3f87 100644 --- a/hubspot/utils/requests/http_request_builder.py +++ b/hubspot/utils/requests/http_request_builder.py @@ -68,7 +68,8 @@ def generate_url(self) -> str: qs = self.options.get("qs") if qs: query_string = urlencode(qs, doseq=True) - url += f"?{query_string}" + delimiter = "&" if "?" in url else "?" + url += f"{delimiter}{query_string}" return url