net-cpp: /home/odroid/lomiri/net-cpp-git/src/net-cpp/include/core/net/http/streaming_client.h Source File

net-cpp .. C++11 library for networking purposes

streaming_client.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_CLIENT_H_
20 #define CORE_NET_HTTP_STREAMING_CLIENT_H_
21
22 #include <core/net/http/client.h>
23
24 #include <core/net/http/streaming_request.h>
25
26 namespace core
27 {
28 namespace net
29 {
30 namespace http
31 {
32 class StreamingClient : public Client
33 {
34 public:
35
36 virtual ~StreamingClient() = default;
37
44 virtual std::shared_ptr<StreamingRequest> streaming_get(const Request::Configuration& configuration) = 0;
45
52 virtual std::shared_ptr<StreamingRequest> streaming_head(const Request::Configuration& configuration) = 0;
53
62 virtual std::shared_ptr<StreamingRequest> streaming_put(const Request::Configuration& configuration, std::istream& payload, std::size_t size) = 0;
63
72 virtual std::shared_ptr<StreamingRequest> streaming_post(const Request::Configuration& configuration, const std::string& payload, const std::string& type) = 0;
73
81 virtual std::shared_ptr<StreamingRequest> streaming_post_form(const Request::Configuration& configuration, const std::map<std::string, std::string>& values) = 0;
82
91 virtual std::shared_ptr<StreamingRequest> streaming_post(const Request::Configuration& configuration, std::istream& payload, std::size_t size) = 0;
92
102 virtual std::shared_ptr<StreamingRequest> streaming_post(const Request::Configuration& configuration, std::function<size_t(void *dest, std::size_t buf_size)> readdata_callback, std::size_t size) = 0;
103
113 virtual std::shared_ptr<StreamingRequest> streaming_put(const Request::Configuration& configuration, std::function<size_t(void *dest, std::size_t buf_size)> readdata_callback, std::size_t size) = 0;
114
121 virtual std::shared_ptr<StreamingRequest> streaming_del(const Request::Configuration& configuration) = 0;
122 };
123
125 CORE_NET_DLL_PUBLIC std::shared_ptr<StreamingClient> make_streaming_client();
126 }
127 }
128 }
129 #endif // CORE_NET_HTTP_STREAMING_CLIENT_H_
core::net::http::StreamingClient::~StreamingClient
virtual ~StreamingClient()=default
streaming_request.h
core::net::http::StreamingClient::streaming_get
virtual std::shared_ptr< StreamingRequest > streaming_get(const Request::Configuration &configuration)=0
streaming_get is a convenience method for issueing a GET request for the given URI.
core::net::http::StreamingClient::streaming_post_form
virtual std::shared_ptr< StreamingRequest > streaming_post_form(const Request::Configuration &configuration, const std::map< std::string, std::string > &values)=0
streaming_post_form is a convenience method for issuing a POST request for the given URI,...
core::net::http::Request::Configuration
The Configuration struct encapsulates all options for creating requests.
Definition: request.h:163
core::net::http::Client
Definition: client.h:44
core::net::http::StreamingClient
Definition: streaming_client.h:33
core::net::http::StreamingClient::streaming_post
virtual std::shared_ptr< StreamingRequest > streaming_post(const Request::Configuration &configuration, std::istream &payload, std::size_t size)=0
streaming_post is a convenience method for issuing a POST request for the given URI.
core::net::http::StreamingClient::streaming_put
virtual std::shared_ptr< StreamingRequest > streaming_put(const Request::Configuration &configuration, std::function< size_t(void *dest, std::size_t buf_size)> readdata_callback, std::size_t size)=0
streaming_put is a convenience method for issuing a PUT request for the given URI.
core
Definition: location.h:24
core::net::http::StreamingClient::streaming_head
virtual std::shared_ptr< StreamingRequest > streaming_head(const Request::Configuration &configuration)=0
streaming_head is a convenience method for issueing a HEAD request for the given URI.
core::net::http::StreamingClient::streaming_del
virtual std::shared_ptr< StreamingRequest > streaming_del(const Request::Configuration &configuration)=0
streaming_del is a convenience method for issuing a DELETE request for the given URI.
CORE_NET_DLL_PUBLIC
#define CORE_NET_DLL_PUBLIC
Definition: visibility.h:25
core::net::http::StreamingClient::streaming_post
virtual std::shared_ptr< StreamingRequest > streaming_post(const Request::Configuration &configuration, std::function< size_t(void *dest, std::size_t buf_size)> readdata_callback, std::size_t size)=0
streaming_post is a convenience method for issuing a POST request for the given URI.
core::net::http::make_streaming_client
CORE_NET_DLL_PUBLIC std::shared_ptr< StreamingClient > make_streaming_client()
Dispatches to the default implementation and returns a streaming client instance.
core::net::http::StreamingClient::streaming_put
virtual std::shared_ptr< StreamingRequest > streaming_put(const Request::Configuration &configuration, std::istream &payload, std::size_t size)=0
streaming_put is a convenience method for issuing a PUT request for the given URI.
client.h
core::net::http::StreamingClient::streaming_post
virtual std::shared_ptr< StreamingRequest > streaming_post(const Request::Configuration &configuration, const std::string &payload, const std::string &type)=0
streaming_post is a convenience method for issuing a POST request for the given URI.