VCV Rack API  v1
rack::network Namespace Reference

Networking functions for HTTP requests, URLs, and downloads. More...

Enumerations

enum  Method { METHOD_GET, METHOD_POST, METHOD_PUT, METHOD_DELETE }
 

Functions

void init ()
 
json_t * requestJson (Method method, std::string url, json_t *dataJ)
 Requests a JSON API URL over HTTP(S), using the data as the query (GET) or the body (POST, etc) Caller must json_decref(). More...
 
bool requestDownload (std::string url, const std::string &filename, float *progress)
 Returns true if downloaded successfully. More...
 
std::string encodeUrl (const std::string &s)
 URL-encodes s More...
 
std::string urlPath (const std::string &url)
 Gets the path portion of the URL. More...
 

Detailed Description

Networking functions for HTTP requests, URLs, and downloads.

Enumeration Type Documentation

◆ Method

Enumerator
METHOD_GET 
METHOD_POST 
METHOD_PUT 
METHOD_DELETE 

Function Documentation

◆ init()

void rack::network::init ( )

◆ requestJson()

json_t* rack::network::requestJson ( Method  method,
std::string  url,
json_t *  dataJ 
)

Requests a JSON API URL over HTTP(S), using the data as the query (GET) or the body (POST, etc) Caller must json_decref().

◆ requestDownload()

bool rack::network::requestDownload ( std::string  url,
const std::string &  filename,
float *  progress 
)

Returns true if downloaded successfully.

◆ encodeUrl()

std::string rack::network::encodeUrl ( const std::string &  s)

URL-encodes s

◆ urlPath()

std::string rack::network::urlPath ( const std::string &  url)

Gets the path portion of the URL.