Audacity 3.2.0
IResponseFactory.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file IResponse.h
6 @brief Declare an interface for HTTP response factory.
7
8 Dmitry Vedenko
9 **********************************************************************/
10
11#pragma once
12
13#include <memory>
14#include <string>
15#include <memory>
16
17namespace audacity
18{
19namespace network_manager
20{
21
22class IResponse;
23class Request;
24class MultipartData;
25
26using ResponsePtr = std::shared_ptr<IResponse>;
27
28class RequestPayloadStream;
29using RequestPayloadStreamPtr = std::shared_ptr<RequestPayloadStream>;
30
31enum class RequestVerb
32{
33 Head,
34 Get,
35 Post,
36 Put,
37 Delete,
38 Patch
39};
40
42{
43public:
44 virtual ~IResponseFactory () = default;
45
46 virtual void setProxy (const std::string& proxy) = 0;
47
48 virtual ResponsePtr performRequest (RequestVerb verb, const Request& request) = 0;
50 RequestVerb verb, const Request& request,
51 RequestPayloadStreamPtr payloadStream) = 0;
52 virtual ResponsePtr performRequest (RequestVerb verb, const Request& request, std::unique_ptr<MultipartData> form) = 0;
53
54 virtual void terminate () = 0;
55};
56
57}
58}
Class to construct the HTTP request.
virtual void setProxy(const std::string &proxy)=0
virtual ResponsePtr performRequest(RequestVerb verb, const Request &request, RequestPayloadStreamPtr payloadStream)=0
virtual ResponsePtr performRequest(RequestVerb verb, const Request &request, std::unique_ptr< MultipartData > form)=0
virtual ResponsePtr performRequest(RequestVerb verb, const Request &request)=0
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:202
std::shared_ptr< IResponse > ResponsePtr
std::shared_ptr< RequestPayloadStream > RequestPayloadStreamPtr
Definition: CurlResponse.h:33