Closed C-Entropy closed 3 years ago
Sorry, I'm not sure what the problem is or what you are asking.
(quri:uri-path (quri:uri "http://www.franz.com/calculator/3%2f2"))
correctly returns the path. From there you can split the components by /
and only then decode.
Example:
(mapcar #'quri:url-decode (str:split "/" (quri:uri-path (quri:uri "http://www.franz.com/calculator/3%2f2")) :omit-nulls t))
; => ("calculator" "3/2")
(I'm not sure if the above code is ideal, maybe quri
can do this directly.)
Your answer looks good to me, since I don't figure out how to achieve it directly using quri
.
Then should I turn to clack?
Since it:
(list
...
:path-info (quri:url-decode (uri-path quri) :lenient t)
...
)
and so :path-info will be "/calculator/3/2"
for this case.
Resulting I am not able to get the ("calculator" "3/2")
as I want.
Thanks you! @Ambrevar
Indeed, I think the problem comes from the caller.
Maybe quri could add a function like puri to return path components.
Feel free to close this if you think there is nothing left to do from the Quri side.
Alright, close it.
Take this as an example:
The example come from section
Parsing, escape decoding/encoding and the path
hereBut, I come into this because this. So, what is the solution for this case? Thank you!