libzypp: zyppng::HttpHeader Class Reference

libzypp 17.38.15

zyppng::HttpHeader Class Reference

Store and provide HTTP header data (key/value). More...

`#include <zypp-curl/ng/network/httpheader.h>`

## Public Member Functions
| HttpHeader (std::string key_r, std::string value_r)
const std::string & | key () const
const std::string & | value () const
std::string | asString () const
| Return valid HTTP header string.

## Static Public Member Functions
static std::string | asString (std::string key_r, std::string value_r)

## Private Attributes
std::string | _key
std::string | _value

## Detailed Description

Store and provide HTTP header data (key/value).

Use asString to get a valid HTTP header.

Definition at line 21 of file httpheader.h.

## Constructor & Destructor Documentation

## ◆ HttpHeader()

zyppng::HttpHeader::HttpHeader | ( | std::string | key_r,
|  | std::string | value_r )
| inline

Definition at line 24 of file httpheader.h.

## Member Function Documentation

## ◆ key()

const std::string & zyppng::HttpHeader::key | ( |  | ) | const
| inline

Definition at line 29 of file httpheader.h.

## ◆ value()

const std::string & zyppng::HttpHeader::value | ( |  | ) | const
| inline

Definition at line 30 of file httpheader.h.

## ◆ asString() [1/2]

std::string zyppng::HttpHeader::asString | ( |  | ) | const
| inline

Return valid HTTP header string.

bsc#1212187: HTTP/2 RFC 9113 forbids fields ending with a space. Empty field values - not desired but legal - however need to be encoded as 'key: '. The space after the colon is not part of the header's value; it is a structural separator required by HTTP/1.1. For HTTP/2 it's not part of the field value.

Definition at line 39 of file httpheader.h.

## ◆ asString() [2/2]

std::string zyppng::HttpHeader::asString | ( | std::string | key_r,
|  | std::string | value_r )
| inlinestatic

Definition at line 42 of file httpheader.h.

## Member Data Documentation

## ◆ _key

std::string zyppng::HttpHeader::_key
| private

Definition at line 46 of file httpheader.h.

## ◆ _value

std::string zyppng::HttpHeader::_value
| private

Definition at line 47 of file httpheader.h.

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

- zypp-curl/ng/network/httpheader.h