Édipo Féderle
Édipo Féderle

Reputation: 4257

Clojure - url "format" in json response

I write a REST API with Clojure liberator, and I have this function, in order to build the URL:

(defn build-entry-url [request]
   (URL. (format "%s://%s:%s%s"
           (name (:scheme request))
           (:server-name request)
           (:server-port request)
           (:context request))))

Then I use halresource for representing resources and cheshire to parse the json. When I use curl, in json response the URL is showed as:

http:\/\/localhost:8080\/api\/customer\/1

But if I use some tool, like Postman, the URL is showed correctly

Any suggestion?

UPDATE: I re-checked and all json is generated correctly, but when I use curl, or trying access the end-point via browser, the URL is showed as: http:\/\/localhost:8080\/api\/customer\/1

Upvotes: 1

Views: 286

Answers (0)

Related Questions