2020-04-15 15:47:06 +03:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2020-04-16 23:22:32 +03:00
|
|
|
#include <map>
|
|
|
|
#include "json11/json11.hpp"
|
2020-04-15 15:47:06 +03:00
|
|
|
|
2020-04-16 23:22:32 +03:00
|
|
|
struct http_response_t
|
|
|
|
{
|
2020-04-25 01:29:31 +03:00
|
|
|
bool eof = false;
|
|
|
|
int error_code = 0;
|
|
|
|
int status_code = 0;
|
2020-04-16 23:22:32 +03:00
|
|
|
std::string status_line;
|
|
|
|
std::map<std::string, std::string> headers;
|
|
|
|
std::string body;
|
|
|
|
};
|
2020-04-15 15:47:06 +03:00
|
|
|
|
2020-04-25 01:29:31 +03:00
|
|
|
void parse_headers(std::string & res, http_response_t *parsed);
|
2020-04-20 15:43:07 +03:00
|
|
|
std::vector<std::string> getifaddr_list(bool include_v6 = false);
|
2020-04-20 17:44:03 +03:00
|
|
|
uint64_t stoull_full(const std::string & str, int base = 10);
|