This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-18
Channels
- # beginners (17)
- # calva (1)
- # clara (1)
- # cljs-dev (12)
- # clojure (151)
- # clojure-france (11)
- # clojure-uk (6)
- # conjure (4)
- # datomic (32)
- # duct (42)
- # emacs (2)
- # fulcro (20)
- # lambdaisland (4)
- # malli (5)
- # meander (32)
- # pathom (8)
- # reagent (1)
- # reitit (7)
- # shadow-cljs (2)
- # sql (6)
- # tools-deps (2)
- # vim (17)
- # xtdb (1)
So you're building up urls from scratch? Data going into the path or into the query string?
Yes and in this case both. The goal is to have the url be a datastructure e.g map that we can add (path,query params) and then prior to use in a http call be converted to a url encoded string. Your lib (ty btw) seems to do all this as well. Though i need ot read the docs again to confirm that the encoding/percent-encoding happens when i join or assoc-query*. another clojurescript lib that does this is cmeriks/url.
assoc-query does, but doing (assoc uri :path ...) it won't, since that's just updating the field in the record. But you can assoc the path and then normalize. I wrote lambdaisland/uri as an as alternative to cemerick/url for three reasons : cross platform cljc, the ability to represent and manipulate relative urls, and an implementation of the rfc algorithm for joining urls (e.g. resolving links)