Fork me on GitHub
#clojure-dev
<
2018-06-27
>
slipset20:06:36

Curious, could https://dev.clojure.org/jira/browse/CLJ-2253 be considered now that clj-1.10 only supports java8 and upwards?

hiredman20:06:48

seems like a bad idea, there are http client libraries out there that work great

slipset20:06:12

sure, but since slurp supports urls, there should be no reason why it doesn't support urls with basic auth in them.

slipset20:06:46

(slurp "") is somewhat handy

hiredman20:06:32

since slurp supports urls with basic auth there is no reason slurp shouldn't support cookies, since slurp supports cookies there is no reason slurp shouldn't support form encoded data, etc etc etc

slipset20:06:05

I guess you could argue that way, but the reason I asked was that previously, there was no clean way to do the base64 encoding, since java6 doesn't have a public base64 function. Java8 does have one such, so that hurdle is out of the way.

slipset20:06:48

Wether or not said functionality is superfantastic enough to be included in Clojure is another question.

slipset20:06:38

Apart from that. your argument doesn't quite hold. slurp supports slurping urls. username and passwords are parts of a url, cookies and form-encoded data is not.

Alex Miller (Clojure team)21:06:22

Every time I look at this ticket, the less I like it :)

bronsa22:06:06

@slipset slurp can already read from http readers

bronsa22:06:12

you just need to pass it the appropriate reader

gfredericks22:06:44

the "is somewhat handy" comment makes me think the goal is a one-liner

bronsa22:06:11

user=> (subs (slurp (.openStream (java.net.URL. ""))) 0 10)
"<!doctype "

gfredericks22:06:20

but so many parentheses....

bronsa22:06:58

I don't see the need to add more complexity to slurp when it already can do it

gfredericks22:06:42

java.net.URL allows basic auth?

gfredericks22:06:36

we should move this to the hypothetical channel #hypothetical-clojure-dev

hiredman22:06:56

#(clojure-dev) and then #((clojure-dev)) and so on

bronsa22:06:58

@gfredericks if you set the global auth it should pick it up

bronsa22:06:20

otherwise doto and -> help here simple_smile

ghadi22:06:56

I lament slurp because it forces the load of http://c.java.io during core.clj load