mirror of
https://github.com/tribufu/sdk-cpp
synced 2025-06-16 13:14:19 +00:00
Add libhv and test http client
This commit is contained in:
34
vendor/libhv/include/hv/hurl.h
vendored
Normal file
34
vendor/libhv/include/hv/hurl.h
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef HV_URL_H_
|
||||
#define HV_URL_H_
|
||||
|
||||
#include <string> // import std::string
|
||||
|
||||
#include "hexport.h"
|
||||
|
||||
class HV_EXPORT HUrl {
|
||||
public:
|
||||
static std::string escape(const std::string& str, const char* unescaped_chars = "");
|
||||
static std::string unescape(const std::string& str);
|
||||
static inline std::string escapeUrl(const std::string& url) {
|
||||
return escape(url, ":/@?=&#+");
|
||||
}
|
||||
|
||||
HUrl() : port(0) {}
|
||||
~HUrl() {}
|
||||
|
||||
void reset();
|
||||
bool parse(const std::string& url);
|
||||
const std::string& dump();
|
||||
|
||||
std::string url;
|
||||
std::string scheme;
|
||||
std::string username;
|
||||
std::string password;
|
||||
std::string host;
|
||||
int port;
|
||||
std::string path;
|
||||
std::string query;
|
||||
std::string fragment;
|
||||
};
|
||||
|
||||
#endif // HV_URL_H_
|
Reference in New Issue
Block a user