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
30class RequestPayloadStream;
31using RequestPayloadStreamPtr = std::shared_ptr<RequestPayloadStream>;
32
34{
37public:
39 static void Terminate ();
40
41 ResponsePtr doGet(const Request& request);
42 ResponsePtr doHead(const Request& request);
43
44 ResponsePtr doDelete(const Request& request);
45
46 ResponsePtr doPost(const Request& request, const void* data, size_t size);
47 ResponsePtr doPost(const Request& request, RequestPayloadStreamPtr payloadStream);
48 ResponsePtr doPost(const Request& request, std::unique_ptr<MultipartData> form);
49
50 ResponsePtr doPut(const Request& request, const void* data, size_t size);
51 ResponsePtr doPut(const Request& request, RequestPayloadStreamPtr payloadStream);
52 ResponsePtr doPut(const Request& request, std::unique_ptr<MultipartData> form);
53
54 ResponsePtr doPatch(const Request& request, const void* data, size_t size);
55 ResponsePtr doPatch(const Request& request, RequestPayloadStreamPtr payloadStream);
56
57 void setProxy (const std::string& proxy);
58private:
59 std::unique_ptr<IResponseFactory> mResponseFactory;
60};
61
62}
63}
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
std::shared_ptr< RequestPayloadStream > RequestPayloadStreamPtr
Definition: CurlResponse.h:33