VCV Rack API v2
Loading...
Searching...
No Matches
network.hpp
Go to the documentation of this file.
1#pragma once
2#include <map>
3
4#include <jansson.h>
5
6#include <common.hpp>
7
8
9namespace rack {
11namespace network {
12
13
14typedef std::map<std::string, std::string> CookieMap;
15
22
28json_t* requestJson(Method method, const std::string& url, json_t* dataJ = NULL, const CookieMap& cookies = {});
32bool requestDownload(const std::string& url, const std::string& filename, float* progress, const CookieMap& cookies = {});
34std::string encodeUrl(const std::string& s);
40std::string urlPath(const std::string& url);
41
42
43} // namespace network
44} // namespace rack
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:30
const char * filename
Definition logger.hpp:41
std::string urlPath(const std::string &url)
Returns the path portion of the URL.
bool requestDownload(const std::string &url, const std::string &filename, float *progress, const CookieMap &cookies={})
Returns true if downloaded successfully.
PRIVATE void destroy()
Method
Definition network.hpp:16
@ METHOD_DELETE
Definition network.hpp:20
@ METHOD_GET
Definition network.hpp:17
@ METHOD_PUT
Definition network.hpp:19
@ METHOD_POST
Definition network.hpp:18
std::map< std::string, std::string > CookieMap
Definition network.hpp:14
std::string encodeUrl(const std::string &s)
URL-encodes a string.
json_t * 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,...
PRIVATE void init()
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9