-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GET request URL string with multiple values for one parameter #113
Comments
Yes, let's try to not parse the :url key in the request map and pass it
unmodified to XHR. Patch welcome!
…On Tue, Mar 27, 2018, 15:23 a1exsh ***@***.***> wrote:
I've seen the discussion here, but my case is subtly different: #47
<#47>
I need to call an API with a URL which contains multiple values for the
same parameter (a list parameter), but I'm not building the URL: I'm
receiving it as part of response from the API. So I can't just use the
:query-params option unless I parse the URL myself before making the
request. And I can't use parse-url because it ignores the multiple values:
=> (:query-params (cljs-http.client/parse-url "http://example.com/?a=1&b=2&a=3"))
{:a "3", :b "2"}
Cannot we really avoid parsing and building the URL in the
cljs-http.client?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#113>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABUPsi08VCO3RR7DRiN2ji9lU1RvuLEks5tij1MgaJpZM4S86h5>
.
|
Yeah, I now see it is bit more complex. Not parsing and re-building the URL will solve the case when you only have the I wonder if we should rather make the parsing and building more flexible in order to be able to accommodate list parameters? E.g. adding an option to |
Wait, |
After some consideration I believe that we should have the behavior of parsing into list by default, w/o an additional parameter to control this. This ensures that the URL is preserved in the process of parsing and rebuilding. If someone wants a finer control, the URL can still be parsed and adjusted to taste. Opened a PR: #116 |
OK, let's close this now since #116 is merged. :) |
I've seen the discussion in #47, but my case is subtly different.
I need to call an API with a URL which contains multiple values for the same parameter (a list parameter), but I'm not building the URL: I'm receiving it as part of response from the API. So I can't just use the
:query-params
option unless I parse the URL myself before making the request. And I can't useparse-url
because it ignores the multiple values:Cannot we really avoid parsing and building the URL in the
cljs-http.client
?The text was updated successfully, but these errors were encountered: