-
Notifications
You must be signed in to change notification settings - Fork 410
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
Skip query param encoding? #605
Comments
After some digging through the code and tinkering, I've found that, even if I disable the URL encoding, this will ultimately result in Java-related URI parsing errors. (with-redefs [clj-http.client/url-encode-illegal-characters identity]
(:body (clj-http.client/get "https://css.gg/css?=link|bulb")))
; eval (current-form): (with-redefs [clj-http.client/url-encode-illegal-c...
; (err) Execution error (URISyntaxException) at java.net.URI$Parser/fail (URI.java:2913).
; (err) Illegal character in query at index 24: https://css.gg/css?=link|bulb So it could be that this just can't be done with the java.net classes. EDIT: |
hey @jeaye (clj-http.client/get "https://css.gg/css?=link,bulb") this one seems like returning what's expected. I know it's undocumented feature but I just somehow happened to find it. |
Oh, that's amazing. Thank you! |
I'm using css.gg to bring in CSS for icons, as mentioned here: https://github.com/astrit/css.gg#3-collection
Currently, I'm trying to port a query from HTML to CLJ. As an HTML stylesheet link, this works fine:
Note that the
|
is not encoded to%7C
. However, if I try this in clj-http, it's always encoded, which breaks the request, since css.gg is expecting the|
separator.I've tried these forms:
It may appear to be working, if you try it, but that's only because it's returning the CSS for
link
alone. Since it's not seeing the|
, it doesn't return the CSS for bulb. Finally, note that this works just fine with curl:$ curl "https://css.gg/css?=link|bulb"
Can I do this with clj-http?
The text was updated successfully, but these errors were encountered: