9#include <json/reader.h>
10#include <json/value.h>
13using Poco::Net::HTTPResponse;
26 std::istream &responseStream) {
27 std::set<HTTPResponse::HTTPStatus> successHTTPStatus = {HTTPResponse::HTTP_OK, HTTPResponse::HTTP_CREATED,
28 HTTPResponse::HTTP_ACCEPTED};
31 if (successHTTPStatus.find(HTTPStatus) == successHTTPStatus.end()) {
34 ::Json::CharReaderBuilder readerBuilder;
38 if (Json::parseFromStream(readerBuilder, responseStream, &json, &errors)) {
39 return json.get(
"code",
"UNKNOWN").asString() +
": " + json.get(
"message",
"Unknown Error").asString();
const std::string getIDSError(const Poco::Net::HTTPResponse::HTTPStatus &HTTPStatus, std::istream &responseStream)
Obtain the error message returned by the IDS.
std::string to_string(const wide_integer< Bits, Signed > &n)