Examples for 'httr::GET'


GET a url.

Aliases: GET

Keywords:

### ** Examples

GET("http://google.com/")
Response [http://www.google.com/]
  Date: 2025-08-11 15:59
  Status: 200
  Content-Type: text/html; charset=ISO-8859-1
  Size: 18.1 kB
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="...
var g=this||self;function k(){return window.google&&window.google.kOPI||null}...
function r(a,b,d,c,h){var e="";b.search("&ei=")===-1&&(e="&ei="+n(c),b.search...
document.documentElement.addEventListener("submit",function(b){var a;if(a=b.t...
</style><style>body,td,a,p,.h{font-family:sans-serif}body{margin:0;overflow-y...
var g=this||self;var k,l=(k=g.mei)!=null?k:1,m,p=(m=g.diel)!=null?m:0,q,r=(q=...
"&bver="+b(w.bv);w.dpf&&(c+="&dpf="+b(w.dpf));var f=a.lineNumber;f!==void 0&&...
if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.fo...
}
})();</script><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a cl...
...
## Not run: 
##D GET("http://google.com/", path = "search")
##D GET("http://google.com/", path = "search", query = list(q = "ham"))
## End(Not run)

# See what GET is doing with httpbin.org
## Not run: 
##D url <- "http://httpbin.org/get"
##D GET(url)
##D GET(url, add_headers(a = 1, b = 2))
##D GET(url, set_cookies(a = 1, b = 2))
##D GET(url, add_headers(a = 1, b = 2), set_cookies(a = 1, b = 2))
##D GET(url, authenticate("username", "password"))
##D GET(url, verbose())
## End(Not run)

# You might want to manually specify the handle so you can have multiple
# independent logins to the same website.
## Not run: 
##D google <- handle("http://google.com")
##D GET(handle = google, path = "/")
##D GET(handle = google, path = "search")
## End(Not run)

[Package httr version 1.4.7 Index]