GithubHelp home page GithubHelp logo

clojure-http-client's People

Contributors

danlarkin avatar joegallo avatar marktriggs avatar pjt avatar raynes avatar technomancy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

clojure-http-client's Issues

header names should be case-insensitive

I think HTTP header names are supposed to be case-insensitive. A server I was working with sent "Set-cookie" instead of "Set-Cookie". I changed the header map to use downcased keywords instead of strings, so e.g. (:content-type headers) instead of (headers "Content-Type"). Not sure about what's best to do here since this breaks backwards compatibility. Also, the request header map has string keys, and it seems strange to have string keys there but keyword keys in the response header map.

My backwards incompatible fix is http://github.com/tomo/clojure-http-client/commit/6becb1a805f25ee5a05490b08b56ba750a57c5c8. It might even break something I'm not using in clojure-http-client itself (resourcefully?), not sure.

Cookies are not persisted when redirects are followed

clojure-http-client somehow loses all the cookies when following a redirect issued by the server. The cookies returned by the server in the first response should be maintained while following redirects if possible, else there should be a way to prevent it from following redirects.

doesn't accept multiple Set-Cookie headers

Servers might send multiple Set-Cookie headers, but clojure-http-client only takes the first (http://github.com/technomancy/clojure-http-client/blob/7b9715e2fa038369a65fed89011471f705dd537b/src/clojure/http/client.clj#L66)

This might apply to other headers, too, I suppose, but I ran into it because the server I was working with set multiple Set-Cookie headers. I'm not sure about the best way to solve this. I had line 66 above use (seq v) instead of just v, but this will screw up anyone currently accessing headers as just values.

Cookies containing "=" are screwed up

If a server sets a cookie value that contains an "=", clojure-http-client can't handle it.

For example, http://www.google.com sets a cookie like "PREF=ID=...:TM=...:LM=...:S=...; expires=Wed, 31-Aug-2011 11:18:19 GMT; path=/; domain=.google.com"

(:cookies (request "http://www.google.com")) looks like
{"domain" ".google.com", "path" "/", "expires" "Wed, 31-Aug-2011 11:18:19 GMT", "PREF" "ID"}

This is a simple fix: http://github.com/tomo/clojure-http-client/commit/f416aaa1909491af3f5e1beb3f320567a23766b5

Basic authentication does not appear to work

I'm trying to make a request using HTTP Basic auth.

Here's what I'm doing:

(ns http-testcase
  (:require [clojure.http.client :as http]))

(defn failure []
  (prn (:body-seq (http/request "http://ieure:[email protected]/"))))

Fire up tcpdump:

$ sudo tcpdump -s0 -w atomized.cap -ien1 -f 'host atomized.org'

Run the code:

(failure)

If you examine the packet capture, there's no Authorization header:

GET / HTTP/1.1
User-Agent: Clojure/{:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"} (+http://clojure.org)
Connection: close
Host: atomized.org
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

clojure.http.client broken re: contrib changes

clojure.http.client is incompatible with the current 1.2 snapshot of contrib. Specifically, c.c.java-utils no longer exists, & as-str has been moved to c.c.string. duck-streams & str-utils still exist but are deprecated.The ns statement can be fixed by replacing the use statement:

(:use [clojure.contrib.java-utils :only [as-str]]
[clojure.contrib.duck-streams :only [read-lines spit]]
[clojure.contrib.str-utils :only [str-join]]
[clojure.contrib.base64 :as base64])

with

(:use [clojure.contrib.io :only [read-lines spit]]
[clojure.contrib.string :only [as-str join]]
[clojure.contrib.base64 :as base64])

(Note: c.c.str-utils/str-join => c.c.string/join)

Best,
Perry

Issue with keywords in URL query parameters

I have URLs with ":name=value" in them and use clojure.http.client to retrieve them. It looks like url-encode uses "as-str" function whose semantics are to drop colon. I am curious to know if this behavior was intended. In any case, I think being able to use parameter names with leading/embedded ':' is legitimate and this gratuitous behavior of "as-str" forces me to duplicate url-encode.

Leiningenize

Can you "Leiningeniize" this and push it to clojars?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.