C++ edjLibrary SDK
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
edjx::fetch::FetchResponse Struct Reference

Response for HTTP fetch request, which may include body, headers, and status code. More...

#include <fetch.hpp>

Public Member Functions

edjx::http::HttpStatusCode get_status_code () const
 Returns the HTTP status code of the fetch response. More...
 
const edjx::http::HttpHeadersget_headers () const
 Returns HTTP headers of the fetch response. More...
 
edjx::error::StreamError read_body (std::vector< uint8_t > &result)
 Reads and returns the HTTP body of the fetch response. More...
 
edjx::stream::ReadStreamget_read_stream ()
 Returns the HTTP body of the fetch response as a read stream. More...
 

Public Attributes

edjx::http::HttpStatusCode status
 HTTP status code of the response. More...
 
edjx::http::HttpHeaders headers
 HTTP headers of the response. More...
 
edjx::stream::ReadStream read_stream
 Body of the response as a stream. More...
 

Detailed Description

Response for HTTP fetch request, which may include body, headers, and status code.

Member Function Documentation

◆ get_headers()

const edjx::http::HttpHeaders & edjx::fetch::FetchResponse::get_headers ( ) const

Returns HTTP headers of the fetch response.

Returns
HTTP headers

◆ get_read_stream()

edjx::stream::ReadStream & edjx::fetch::FetchResponse::get_read_stream ( )

Returns the HTTP body of the fetch response as a read stream.

Returns
Response body as a stream.

◆ get_status_code()

edjx::http::HttpStatusCode edjx::fetch::FetchResponse::get_status_code ( ) const

Returns the HTTP status code of the fetch response.

Returns
Response status code

◆ read_body()

edjx::error::StreamError edjx::fetch::FetchResponse::read_body ( std::vector< uint8_t > &  result)

Reads and returns the HTTP body of the fetch response.

This method should not be called more than once.

Parameters
resultResponse body will be copied to this object.
Returns
Returns edjx::error::StreamError::Success on success, edjx::error::StreamError::EndOfStream when end of stream is reached, or some other value on failure.

Member Data Documentation

◆ headers

edjx::http::HttpHeaders edjx::fetch::FetchResponse::headers

HTTP headers of the response.

◆ read_stream

edjx::stream::ReadStream edjx::fetch::FetchResponse::read_stream

Body of the response as a stream.

◆ status

edjx::http::HttpStatusCode edjx::fetch::FetchResponse::status

HTTP status code of the response.


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