Audacity 3.2.0
NetworkManager.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file NetworkManager.h
6 @brief Declare a class for performing HTTP requests.
7
8 Dmitry Vedenko
9 **********************************************************************/
10
11#pragma once
12
13#include <memory>
14#include <string>
15
16#include "NetworkManagerApi.h"
17
18namespace audacity
19{
20namespace network_manager
21{
22
23class Request;
24class IResponse;
25class IResponseFactory;
26class MultipartData;
27
28using ResponsePtr = std::shared_ptr<IResponse>;
29
31{
34public:
36 static void Terminate ();
37
38 ResponsePtr doGet(const Request& request);
39 ResponsePtr doHead(const Request& request);
40
41 ResponsePtr doDelete(const Request& request);
42
43 ResponsePtr doPost(const Request& request, const void* data, size_t size);
44 ResponsePtr doPost(const Request& request, std::unique_ptr<MultipartData> form);
45
46 ResponsePtr doPut(const Request& request, const void* data, size_t size);
47 ResponsePtr doPut(const Request& request, std::unique_ptr<MultipartData> form);
48
49 ResponsePtr doPatch(const Request& request, const void* data, size_t size);
50
51 void setProxy (const std::string& proxy);
52private:
53 std::unique_ptr<IResponseFactory> mResponseFactory;
54};
55
56}
57}
Declare macros for the Network Manager library DLL API.
#define NETWORK_MANAGER_API
Class to construct the HTTP request.
std::unique_ptr< IResponseFactory > mResponseFactory
FrameStatistics & GetInstance() noexcept
std::shared_ptr< IResponse > ResponsePtr