VCV Rack API v2
Loading...
Searching...
No Matches
network.hpp File Reference
#include <map>
#include <jansson.h>
#include <common.hpp>
Include dependency graph for network.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  rack
 Root namespace for the Rack API.
 
namespace  rack::network
 Networking functions for HTTP requests, downloads, and URLs.
 

Typedefs

typedef std::map< std::string, std::string > rack::network::CookieMap
 

Enumerations

enum  rack::network::Method { rack::network::METHOD_GET , rack::network::METHOD_POST , rack::network::METHOD_PUT , rack::network::METHOD_DELETE }
 

Functions

PRIVATE void rack::network::init ()
 
PRIVATE void rack::network::destroy ()
 
json_t * rack::network::requestJson (Method method, const std::string &url, json_t *dataJ=NULL, const CookieMap &cookies={})
 Requests a JSON API URL over HTTP(S), using the data as the query (GET) or the body (POST, etc) Caller must json_decref() if return value is non-NULL.
 
bool rack::network::requestDownload (const std::string &url, const std::string &filename, float *progress, const CookieMap &cookies={})
 Returns true if downloaded successfully.
 
std::string rack::network::encodeUrl (const std::string &s)
 URL-encodes a string.
 
std::string rack::network::urlPath (const std::string &url)
 Returns the path portion of the URL.