Potential bug in
I'm getting an error with
Here's the call that causes it on my machine:
res <- GET("http://pkp-alm.lib.sfu.ca/api/v5/articles?api_key=<apikey>&ids=10.11606/issn.1981-1624.v18i1p153-165", verbose())
-> GET /api/v5/articles?api_key=<apikey>&ids=10.11606/issn.1981-1624.v18i1p153-165 HTTP/1.1 -> User-Agent: curl/7.30.0 Rcurl/18.104.22.168 httr/0.5.0.9000 -> Host: pkp-alm.lib.sfu.ca -> Accept-Encoding: gzip -> Cookie: request_method=GET -> Accept: application/json, text/xml, application/xml, */* -> <- HTTP/1.1 200 <- Date: Tue, 14 Oct 2014 16:49:48 GMT <- Server: Apache/2.2.15 (Red Hat) <- X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.19 <- Access-Control-Allow-Origin: * <- Access-Control-Allow-Methods: POST, GET, OPTIONS <- Access-Control-Max-Age: 1728000 <- X-UA-Compatible: IE=Edge,chrome=1 <- ETag: "46e00759ce8ff06a39a4cf44d82d2b35" <- Cache-Control: must-revalidate, private, max-age=0 <- X-Request-Id: dc02d47566eb504ce3dff78157be10b7 <- X-Runtime: 0.051983 <- X-Rack-Cache: miss <- Status: 200 <- Content-Length: 5430 <- Connection: close <- Content-Type: application/json; charset=utf-8 <- Error in names(status) <- c("version", "status", "message") : 'names' attribute  must be the same length as the vector 
This call works fine with curl on the cli, or
The text was updated successfully, but these errors were encountered:
As you can see on the first line below the response header seems to be missing the message (.e.g,
So on line https://github.com/hadley/httr/blob/master/R/perform.R#L76 the vector split out returns list of length 2
[]  "HTTP/1.1" []  "200"
instead of length 3. And then the names assignment https://github.com/hadley/httr/blob/master/R/perform.R#L77 fails.
I don't know you think this is simply a problem for the API provider to fix, or if you thin you could handle this case in