GET(url) gets different results than browser #27
Comments
Looks like the problem is that httr appended "=NA" to the end of the URL. Not sure why.... |
I'll have to check the spec, but that doesn't look like a valid URL. Httr should behave better though |
Thats likely the problem. Looks like everything else was escaped correctly. From the W3C spec: The query parameter canonicalization of a string s is the query canonicalization of s, modified as follows: Replace all instances of the U+0026 AMPERSAND (&) character with %26. Replace all instances of the U+003D EQUALS SIGN (=) character with %3D. On Dec 30, 2012, at 12:30 AM, hadley wickham notifications@github.com wrote:
|
I'll take a look when I'm next working on httr. |
this might be another one.. :) i tried the url he's described with httr and it also returned a different result from chrome and firefox.. http://stackoverflow.com/questions/14148596/retrieving-url-using-rcurl-gives-different-date-format-than-in-browser |
Closed in 46c1fe9 |
library(httr)
url <- "http://www.kegg.jp/kegg-bin/show_pathway?eco00260/eco%3ab0002%09%23ff0000,%23ffff00/eco%3ac00263%09%2300ff00,yellow"
GET(url)
results in:
Response [http://www.kegg.jp/kegg-bin/show_pathway?eco00260/eco%3ab0002%09%23ff0000,%23ffff00/eco%3ac00263%09%2300ff00,yellow=NA]
Status: 200
Content-type: text/html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Usage</title>
<link rel="stylesheet" href="/css/kegg2.css" type="text/css">
</head>
<body>
<h3>cannot create 0 (no link ko_kid)type </h3>
</body>
</html>
Whereas if I paste that URL into a browser, I get different (much longer) results.
Am I doing something wrong or is it a bug?
Dan
sessionInfo()
R Under development (unstable) (2012-12-15 r61341)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] httr_0.2
loaded via a namespace (and not attached):
[1] digest_0.6.0 RCurl_1.95-3 stringr_0.6.2 tools_3.0.0
The text was updated successfully, but these errors were encountered: