4#include <unordered_map>
10#define HTTP_API __attribute__((visibility("default")))
12#define HTTP_API __declspec(dllexport)
14#define HTTP_API_FUNCTION extern "C" HTTP_API
18#define HTTP_API_FUNCTION
107 return stream << static_cast<int>(responseCode);
118 return code ==
static_cast<int>(otherCode);
147 template<
typename T>
requires (std::same_as<T, ResponseCodes> || std::convertible_to<T, int>)
155 size_t operator () (
const std::string& value)
const;
161 bool operator () (
const std::string& left,
const std::string& right)
const;
171 std::optional<std::string> fileName;
172 std::optional<std::string> contentType;
178 Multipart(std::string_view name,
const std::optional<std::string>& fileName,
const std::optional<std::string>& contentType, std::string&& data);
180 const std::string& getName()
const;
182 const std::optional<std::string>& getFileName()
const;
184 const std::optional<std::string>& getContentType()
const;
186 const std::string& getData()
const;
194 using HeadersMap = std::unordered_map<std::string, std::string, InsensitiveStringHash, InsensitiveStringEqual>;
199 template<
typename T>
requires (std::same_as<T, ResponseCodes> || std::convertible_to<T, int>)
#define HTTP_API_FUNCTION
Defines each part of multipart/form-data.
Multipart(std::string_view data)
Multipart(std::string_view name, const std::optional< std::string > &fileName, const std::optional< std::string > &contentType, std::string &&data)
std::unordered_map< std::string, std::string, InsensitiveStringHash, InsensitiveStringEqual > HeadersMap
Case insensitive unordered_map.
ResponseCodes
Response codes.
@ networkAuthenticationRequired
@ HTTPVersionNotSupported
@ proxyAuthenticationRequired
@ unavailableForLegalReasons
@ requestHeaderFieldsTooLarge
@ nonAuthoritativeInformation
std::string getMessageFromCode(const T &code)
Get response message from response code.
string __getMessageFromCode(int code)
ostream & operator<<(ostream &outputStream, const HTTPBuilder &builder)
string getHTTPLibraryVersion()
Get version of HTTP library.
string decodeUrl(string_view data)
string encodeUrl(string_view data)
bool operator==(int code, ResponseCodes otherCode)
Compare operator for ResponseCodes.
Custom equal for headers.
Custom hashing for headers with case insensitive.