Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Allow java.net.URL to be passed to api fns like client/get
Browse files Browse the repository at this point in the history
  • Loading branch information
katox committed Nov 13, 2013
1 parent c3e5b82 commit 004a50a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/clj_http/lite/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"Batteries-included HTTP client."
(:use [slingshot.slingshot :only [throw+]])
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clj-http.lite.core :as core]
[clj-http.lite.util :as util])
(:import (java.io InputStream File)
Expand All @@ -15,7 +16,7 @@
(when (and v (pos? v)) v))

(defn parse-url [url]
(let [url-parsed (URL. url)]
(let [url-parsed (io/as-url url)]
{:scheme (keyword (.getProtocol url-parsed))
:server-name (.getHost url-parsed)
:server-port (when-pos (.getPort url-parsed))
Expand Down

0 comments on commit 004a50a

Please sign in to comment.