Arachne 1.0
Arachne - the perpetual stitcher of Wikidata entities.
Loading...
Searching...
No Matches
corespace::http_response Struct Reference

Result object for an HTTP transfer. More...

#include <include/utils.hpp>

Public Types

using header_map = std::multimap<std::string, std::string, std::less<>>
 Case-preserving multimap of response headers (as returned by libcurl).

Public Attributes

size_t status_code = 0
 HTTP status code (e.g., 200, 404).
header_map header
 Response headers from the final attempt.
std::string text
 Response body accumulated across callbacks.
CURLcode error_code = CURLE_OK
 libcurl transport/result code.
std::string error_message
 Non-empty on libcurl error.

Detailed Description

Result object for an HTTP transfer.

Invariants:

  • error_code == CURLE_OK means libcurl completed without a transport error.
  • status_code carries the HTTP status (2xx denotes success).
  • header contains response headers from the final transfer attempt.
  • text accumulates the response body as received.
  • When error_code != CURLE_OK, error_message contains a stable human-readable description (from curl_easy_strerror).

Definition at line 145 of file utils.hpp.

Member Typedef Documentation

◆ header_map

using corespace::http_response::header_map = std::multimap<std::string, std::string, std::less<>>

Case-preserving multimap of response headers (as returned by libcurl).

Definition at line 147 of file utils.hpp.

Member Data Documentation

◆ error_code

CURLcode corespace::http_response::error_code = CURLE_OK

◆ error_message

std::string corespace::http_response::error_message

Non-empty on libcurl error.

Definition at line 153 of file utils.hpp.

Referenced by corespace::http_client::request_get(), and corespace::http_client::request_post().

◆ header

header_map corespace::http_response::header

Response headers from the final attempt.

Definition at line 150 of file utils.hpp.

◆ status_code

size_t corespace::http_response::status_code = 0

HTTP status code (e.g., 200, 404).

Definition at line 149 of file utils.hpp.

◆ text

std::string corespace::http_response::text

Response body accumulated across callbacks.

Definition at line 151 of file utils.hpp.


The documentation for this struct was generated from the following file: