27 lines
789 B
C++
27 lines
789 B
C++
#pragma once
|
|
|
|
#include <json/json.h>
|
|
|
|
#include <map>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace visione::oidc
|
|
{
|
|
struct HttpResponseData
|
|
{
|
|
int statusCode{0};
|
|
std::string body;
|
|
std::map<std::string, std::string> headers;
|
|
};
|
|
|
|
HttpResponseData httpGet(const std::string &url, double timeoutSeconds = 5.0);
|
|
HttpResponseData httpGet(const std::string &url,
|
|
const std::map<std::string, std::string> &headers,
|
|
double timeoutSeconds = 5.0);
|
|
HttpResponseData httpPostForm(const std::string &url,
|
|
const std::map<std::string, std::string> ¶ms,
|
|
double timeoutSeconds = 5.0);
|
|
Json::Value parseJsonResponse(const HttpResponseData &response);
|
|
} // namespace visione::oidc
|