Learn R Programming

nanonext (version 0.2.0)

ncurl: ncurl

Description

nano cURL - a minimalistic http(s) client.

Usage

ncurl(http)

Arguments

http

the URL/address of the resource to retrieve.

Value

Named list of 2 elements:

  • $raw - a raw vector of the received resource (may be saved to a file using writeBin to re-create the original)

  • $data - the raw vector converted to a character string (if the served content was a recognised text format), allowing further parsing within R as html, json, xml etc., or NULL otherwise (if the content was a binary file etc.)

Redirects

In interactive sessions, will prompt upon receiving a redirect location whether to follow or not (default: yes). In non-interactive sessions, redirects are never followed.

TLS Support

Connecting to secure https sites is supported if your version of the NNG library was built with TLS support (using Mbed TLS) and the environment variable 'NANONEXT_TLS' was set when installing the package e.g. by Sys.setenv(NANONEXT_TLS=1). Note: not applicable for Windows systems.

Examples

Run this code
# NOT RUN {
ncurl("http://httpbin.org/headers")

# }

Run the code above in your browser using DataLab