
Last chance! 50% off unlimited learning
Sale ends in
GET(url = NULL, config = list(), ..., handle = NULL)
authenticate
), additional headers
(add_headers
), cookies (
query
, path
, etc,
passed on to modify_url
. Unnamed parameters will be combined
with config
.handle_pool
based on the scheme, hostname and port of the url. By default The semantics of the GET method change to a "conditional GET" if the request message includes an If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring multiple requests or transferring data already held by the client.
The semantics of the GET method change to a "partial GET" if the request
message includes a Range header field. A partial GET requests that only
part of the entity be transferred, as described in
BROWSE
;
DELETE
; HEAD
GET("http://google.com/")
GET("http://google.com/", path = "search")
GET("http://google.com/", path = "search", query = list(q = "ham"))
# See what GET is doing with httpbin.org
url <- "http://httpbin.org/get"
GET(url)
GET(url, add_headers(a = 1, b = 2))
GET(url, set_cookies(a = 1, b = 2))
GET(url, add_headers(a = 1, b = 2), set_cookies(a = 1, b = 2))
GET(url, authenticate("username", "password"))
GET(url, verbose())
# You might want to manually specify the handle so you can have multiple
# independent logins to the same website.
google <- handle("http://google.com")
GET(handle = google, path = "/")
GET(handle = google, path = "search")
Run the code above in your browser using DataLab