Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::networking::URL Class Referencefinal

Data Structures

class  MultiPartMimeObject

Public Types

using AsyncStringResult = std::variant<std::string, std::exception_ptr>
using GetContentsAsyncCallback = std::function<void (AsyncStringResult)>

Public Member Functions

 URL (const std::string &url)
std::string get_page_contents (int timeout=0)
 Returns the contents of the page synchronously.
utils::Utf8String post_json_no_auth (const std::string &json_str, int timeout, std::initializer_list< MultiPartMimeObject > mime_objects)
 Posts the given JSON to the URL without any authentication.
std::future< void > get_page_contents_async (int timeout_ms, GetContentsAsyncCallback callback)

Detailed Description

Definition at line 19 of file networking.h.

Member Typedef Documentation

◆ AsyncStringResult

using zrythm::networking::URL::AsyncStringResult = std::variant<std::string, std::exception_ptr>

Definition at line 64 of file networking.h.

◆ GetContentsAsyncCallback

using zrythm::networking::URL::GetContentsAsyncCallback = std::function<void (AsyncStringResult)>

Definition at line 65 of file networking.h.

Member Function Documentation

◆ get_page_contents()

std::string zrythm::networking::URL::get_page_contents ( int timeout = 0)

Returns the contents of the page synchronously.

Parameters
timeoutTimeout in milliseconds. If 0, this will use whatever default setting the OS chooses. If a negative number, it will be infinite.
Exceptions
ZrythmExceptionon error.

◆ post_json_no_auth()

utils::Utf8String zrythm::networking::URL::post_json_no_auth ( const std::string & json_str,
int timeout,
std::initializer_list< MultiPartMimeObject > mime_objects )

Posts the given JSON to the URL without any authentication.

Parameters
timeoutTimeout, in milliseconds.
mime_objectsOptional files to send as multi-part mime objects.
Exceptions
ZrythmExceptionon error.

The documentation for this class was generated from the following file: