net-cpp
..
C++11 library for networking purposes
streaming_request.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2013 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
17
* Gary Wang <gary.wang@canonical.com>
18
*/
19
#ifndef CORE_NET_HTTP_STREAMING_REQUEST_H_
20
#define CORE_NET_HTTP_STREAMING_REQUEST_H_
21
22
#include <
core/net/http/request.h
>
23
24
namespace
core
25
{
26
namespace
net
27
{
28
namespace
http
29
{
34
class
CORE_NET_DLL_PUBLIC
StreamingRequest
:
public
Request
35
{
36
public
:
37
39
typedef
std::function<void(
const
std::string&)>
DataHandler
;
40
47
virtual
Response
execute(
const
ProgressHandler
& ph,
const
DataHandler
& dh) = 0;
48
55
virtual
void
async_execute(
const
Handler
& handler,
const
DataHandler
& dh) = 0;
56
62
virtual
void
pause() = 0;
63
68
virtual
void
resume() = 0;
69
76
virtual
void
abort_request_if(std::uint64_t limit,
const
std::chrono::seconds& time) = 0;
77
};
78
}
79
}
80
}
81
82
#endif // CORE_NET_HTTP_STREAMING_REQUEST_H_
core::net::http::StreamingRequest
The StreamingRequest class encapsulates a request for a web resource, streaming data to the receiver ...
Definition:
streaming_request.h:34
core::net::http::Response
The Response struct models a response to a core::net::http::Request.
Definition:
response.h:39
core::net::http::Request::Handler
Encapsulates callbacks that can happen during request execution.
Definition:
request.h:119
core
Definition:
location.h:23
request.h
CORE_NET_DLL_PUBLIC
#define CORE_NET_DLL_PUBLIC
Definition:
visibility.h:25
core::net::http::Request::ProgressHandler
std::function< Progress::Next(const Progress &)> ProgressHandler
ProgressHandler is invoked for progress updates while executing the request.
Definition:
request.h:109
core::net::http::StreamingRequest::DataHandler
std::function< void(const std::string &)> DataHandler
Definition:
streaming_request.h:39
core::net::http::Request
The Request class encapsulates a request for a web resource.
Definition:
request.h:41
include
core
net
http
streaming_request.h
Generated on Tue Feb 18 2020 12:24:20 for net-cpp by
1.8.17