client-cpp  0.10.0
MultipartPostHttpRequest.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MULTIPARTPOSTHTTPREQUEST_HPP_
18 #define MULTIPARTPOSTHTTPREQUEST_HPP_
19 
20 #include "kaa/KaaDefaults.hpp"
21 
23 #include "kaa/http/HttpUrl.hpp"
25 
26 #include <map>
27 #include <vector>
28 
29 namespace kaa {
30 
32 public:
34  virtual ~MultipartPostHttpRequest();
35 
36  virtual std::string getHost() const;
37  virtual std::uint16_t getPort() const;
38  virtual std::string getRequestData() const;
39  virtual void setHeaderField(const std::string& name, const std::string& value);
40  virtual void removeHeaderField(const std::string& name);
41 
42  void setBodyField(const std::string& name, const std::vector<std::uint8_t>& value);
43  void removeBodyField(const std::string& name);
44 
45 private:
46  static const std::string BOUNDARY;
47 
48 private:
49  HttpUrl url_;
50  std::map<std::string, std::string> headerFields_;
51  std::map<std::string, std::vector<std::uint8_t>> bodyFields_;
52 
53  IKaaClientContext &context_;
54 };
55 
56 }
57 
58 #endif /* MULTIPARTPOSTHTTPREQUEST_HPP_ */
virtual std::string getRequestData() const
virtual std::uint16_t getPort() const
void setBodyField(const std::string &name, const std::vector< std::uint8_t > &value)
virtual void removeHeaderField(const std::string &name)
virtual void setHeaderField(const std::string &name, const std::string &value)
virtual std::string getHost() const
void removeBodyField(const std::string &name)
MultipartPostHttpRequest(const HttpUrl &url, IKaaClientContext &context)