staticlib_http  1.3.2
 All Classes Namespaces Files Functions Variables
request_options.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2016, alex at staticlibs.net
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 /*
18  * File: request_options.hpp
19  * Author: alex
20  *
21  * Created on February 8, 2016, 2:51 PM
22  */
23 
24 #ifndef STATICLIB_HTTP_REQUEST_OPTIONS_HPP
25 #define STATICLIB_HTTP_REQUEST_OPTIONS_HPP
26 
27 #include <string>
28 #include <vector>
29 #include <utility>
30 #include <cstdint>
31 
32 namespace staticlib {
33 namespace http {
34 
39 
40  // options implemented manually
41 
45  std::vector<std::pair<std::string, std::string>> headers;
49  std::string method = "";
67 
74 
80 
81  // general behavior options
82 
86  bool force_http_10 = false;
90  bool noprogress = true;
94  bool nosignal = true;
98  bool failonerror = false;
102  bool path_as_is = true;
103 
104  // TCP options
105 
109  bool tcp_nodelay = false;
113  bool tcp_keepalive = false;
117  uint32_t tcp_keepidle_secs = 300;
121  uint32_t tcp_keepintvl_secs = 300;
125  uint32_t connecttimeout_millis = 10000;
129  uint32_t timeout_millis = 15000;
130 
131  // HTTP options
132 
136  uint32_t buffersize_bytes = 16384;
140  std::string accept_encoding = "gzip";
144  bool followlocation = true;
148  uint32_t maxredirs = 32;
152  // "Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; GT-I9505 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
153  std::string useragent = "";
154 
155  // throttling options
156 
165 
166  // SSL options
167 
171  std::string sslcert_filename = "";
175  std::string sslcertype = "";
179  std::string sslkey_filename = "";
183  std::string ssl_key_type = "";
187  std::string ssl_keypasswd = "";
191  bool require_tls = false;
195  bool ssl_verifyhost = false;
199  bool ssl_verifypeer = false;
203  bool ssl_verifystatus = false;
207  std::string cainfo_filename = "";
211  std::string crlfile_filename = "";
215  std::string ssl_cipher_list = "";
216 };
217 
218 } // namespace
219 }
220 
221 #endif /* STATICLIB_HTTP_REQUEST_OPTIONS_HPP */
222