XRootD
Loading...
Searching...
No Matches
XrdClHttpResponseInfo.hh
Go to the documentation of this file.
1
/***************************************************************
2
*
3
* Copyright (C) 2025, Morgridge Institute for Research
4
*
5
***************************************************************/
6
7
#ifndef XRDCLHTTP_CURLRESPONSEINFO_HH
8
#define XRDCLHTTP_CURLRESPONSEINFO_HH
9
10
#include <memory>
11
#include <string>
12
#include <unordered_map>
13
#include <vector>
14
15
namespace
XrdClHttp
{
16
17
// Representation of the information contained in a response.
18
class
ResponseInfo
{
19
public
:
20
// Force the response information to be virtual, allowing RTTI and easing potential ABI changes
21
virtual
~ResponseInfo
() {};
22
23
// A list of header values in the order they occurred in the response.
24
// Typically, only one element is in the vector.
25
using
HeaderValues
= std::vector<std::string>;
26
27
// Map of header key to header value(s). The header key is *case sensitive*;
28
// queries should be done using the "canonical" form (see
29
// https://cs.opensource.google/go/go/+/refs/tags/go1.24.2:src/net/textproto/reader.go;l=647)
30
using
HeaderMap
= std::unordered_map<std::string, HeaderValues>;
31
32
// List of response headers, one entry per response received through the
33
// operation; potentially there are multiple if there was a redirect
34
using
HeaderResponses
= std::vector<HeaderMap>;
35
36
const
HeaderResponses
&
GetHeaderResponse
()
const
{
return
m_header_responses;}
37
38
// Adds a set of headers to the internal response object.
39
void
AddResponse
(
HeaderMap
&&map) {m_header_responses.emplace_back(map);}
40
41
private
:
42
std::vector<std::unordered_map<std::string, std::vector<std::string>>> m_header_responses;
43
};
44
45
}
// namespace XrdClHttp
46
47
#endif
// XRDCLHTTP_CURLRESPONSEINFO_HH
XrdClHttp::ResponseInfo
Definition
XrdClHttpResponseInfo.hh:18
XrdClHttp::ResponseInfo::HeaderValues
std::vector< std::string > HeaderValues
Definition
XrdClHttpResponseInfo.hh:25
XrdClHttp::ResponseInfo::AddResponse
void AddResponse(HeaderMap &&map)
Definition
XrdClHttpResponseInfo.hh:39
XrdClHttp::ResponseInfo::HeaderResponses
std::vector< HeaderMap > HeaderResponses
Definition
XrdClHttpResponseInfo.hh:34
XrdClHttp::ResponseInfo::GetHeaderResponse
const HeaderResponses & GetHeaderResponse() const
Definition
XrdClHttpResponseInfo.hh:36
XrdClHttp::ResponseInfo::~ResponseInfo
virtual ~ResponseInfo()
Definition
XrdClHttpResponseInfo.hh:21
XrdClHttp::ResponseInfo::HeaderMap
std::unordered_map< std::string, HeaderValues > HeaderMap
Definition
XrdClHttpResponseInfo.hh:30
XrdClHttp
Definition
XrdClHttpChecksum.hh:28
XrdClHttp
XrdClHttpResponseInfo.hh
Generated by
1.16.1