A verbose connection provides much more information about the flow of information between the client and server.

verbose(data_out = TRUE, data_in = FALSE, info = FALSE,
  ssl = FALSE)

Arguments

data_out

Show data sent to the server.

data_in

Show data recieved from the server.

info

Show informational text from curl. This is mainly useful for debugging https and auth problems, so is disabled by default.

ssl

Show even data sent/recieved over SSL connections?

Prefixes

verbose() uses the following prefixes to distinguish between different components of the http messages:

  • * informative curl messages

  • -> headers sent (out)

  • >> data sent (out)

  • *> ssl data sent (out)

  • <- headers received (in)

  • << data received (in)

  • <* ssl data received (in)

See also

with_verbose() makes it easier to use verbose mode even when the requests are buried inside another function call.

Other config: add_headers, authenticate, config, set_cookies, timeout, use_proxy, user_agent

Examples

GET("http://httpbin.org", verbose())
#> Response [http://httpbin.org/] #> Date: 2018-12-17 20:45 #> Status: 200 #> Content-Type: text/html; charset=utf-8 #> Size: 10.1 kB #> <!DOCTYPE html> #> <html lang="en"> #> #> <head> #> <meta charset="UTF-8"> #> <title>httpbin.org</title> #> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Sou... #> rel="stylesheet"> #> <link rel="stylesheet" type="text/css" href="/flasgger_static/swagger-ui.... #> <link rel="icon" type="image/png" href="/static/favicon.ico" sizes="64x64... #> ...
GET("http://httpbin.org", verbose(info = TRUE))
#> Response [http://httpbin.org/] #> Date: 2018-12-17 20:45 #> Status: 200 #> Content-Type: text/html; charset=utf-8 #> Size: 10.1 kB #> <!DOCTYPE html> #> <html lang="en"> #> #> <head> #> <meta charset="UTF-8"> #> <title>httpbin.org</title> #> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Sou... #> rel="stylesheet"> #> <link rel="stylesheet" type="text/css" href="/flasgger_static/swagger-ui.... #> <link rel="icon" type="image/png" href="/static/favicon.ico" sizes="64x64... #> ...
f <- function() { GET("http://httpbin.org") } with_verbose(f())
#> Response [http://httpbin.org/] #> Date: 2018-12-17 20:45 #> Status: 200 #> Content-Type: text/html; charset=utf-8 #> Size: 10.1 kB #> <!DOCTYPE html> #> <html lang="en"> #> #> <head> #> <meta charset="UTF-8"> #> <title>httpbin.org</title> #> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Sou... #> rel="stylesheet"> #> <link rel="stylesheet" type="text/css" href="/flasgger_static/swagger-ui.... #> <link rel="icon" type="image/png" href="/static/favicon.ico" sizes="64x64... #> ...
with_verbose(f(), info = TRUE)
#> Response [http://httpbin.org/] #> Date: 2018-12-17 20:45 #> Status: 200 #> Content-Type: text/html; charset=utf-8 #> Size: 10.1 kB #> <!DOCTYPE html> #> <html lang="en"> #> #> <head> #> <meta charset="UTF-8"> #> <title>httpbin.org</title> #> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Sou... #> rel="stylesheet"> #> <link rel="stylesheet" type="text/css" href="/flasgger_static/swagger-ui.... #> <link rel="icon" type="image/png" href="/static/favicon.ico" sizes="64x64... #> ...
# verbose() makes it easy to see exactly what POST requests send POST_verbose <- function(body, ...) { POST("https://httpbin.org/post", body = body, verbose(), ...) invisible() } POST_verbose(list(x = "a", y = "b"))
#>
POST_verbose(list(x = "a", y = "b"), encode = "form")
#>
POST_verbose(FALSE) POST_verbose(NULL) POST_verbose("") POST_verbose("xyz")
#>