client-cpp  0.0.1-SNAPSHOT
MultipartPostHttpRequest.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014 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 
21 #include "kaa/http/HttpUrl.hpp"
22 
23 #include <map>
24 #include <vector>
25 
26 namespace kaa {
27 
29 public:
31  virtual ~MultipartPostHttpRequest();
32 
33  virtual std::string getHost() const;
34  virtual uint16_t getPort() const;
35  virtual std::string getRequestData() const;
36  virtual void setHeaderField(const std::string& name, const std::string& value);
37  virtual void removeHeaderField(const std::string& name);
38 
39  void setBodyField(const std::string& name, const std::vector<boost::uint8_t>& value);
40  void removeBodyField(const std::string& name);
41 
42 private:
43  static const std::string BOUNDARY;
44 
45 private:
46  HttpUrl url_;
47  std::map<std::string, std::string> headerFields_;
48  std::map<std::string, std::vector<boost::uint8_t>> bodyFields_;
49 };
50 
51 }
52 
53 
54 
55 #endif /* MULTIPARTPOSTHTTPREQUEST_HPP_ */
void setBodyField(const std::string &name, const std::vector< boost::uint8_t > &value)
virtual std::string getRequestData() const
MultipartPostHttpRequest(const HttpUrl &url)
virtual void removeHeaderField(const std::string &name)
virtual uint16_t getPort() const
virtual void setHeaderField(const std::string &name, const std::string &value)
virtual std::string getHost() const
void removeBodyField(const std::string &name)