Skip to content

Support query params in request#9

Merged
nmkip0 merged 1 commit intomasterfrom
push-vtopwxuqpxop
Sep 29, 2025
Merged

Support query params in request#9
nmkip0 merged 1 commit intomasterfrom
push-vtopwxuqpxop

Conversation

@nmkip0
Copy link
Contributor

@nmkip0 nmkip0 commented Sep 18, 2025

No description provided.

Comment on lines +12 to +18
(defn ->url [url query-params]
(if query-params
(let [builder (.newBuilder (HttpUrl/parse url))]
(doseq [[k v] query-params]
(.addQueryParameter builder (name k) (str v)))
(str (.build builder)))
url))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should rather always return an HttpUrl instead of re-encoding to a string. The RequestBuilder supports passing an HttpUrl directly and probably converts the given string to one anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@julienvincent
Copy link
Contributor

Also, please add a test for this.

@nmkip0 nmkip0 merged commit 2c749bf into master Sep 29, 2025
1 check passed
@nmkip0 nmkip0 deleted the push-vtopwxuqpxop branch September 29, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants