staticlib_http  1.3.2
 All Classes Namespaces Files Functions Variables
Public Member Functions | List of all members
staticlib::http::resource Class Reference

Remote HTTP resource that can be read from as a Source More...

#include <staticlib/http/resource.hpp>

Public Member Functions

virtual std::streamsize read (sl::io::span< char > span)
 PIMPL-specific constructor.
virtual const std::string & get_url () const
 Returns URL of this resource.
virtual uint16_t get_status_code () const
 Returns HTTP status code.
virtual resource_info get_info () const
 Accessor for the resource metainformation.
virtual const std::vector
< std::pair< std::string,
std::string > > & 
get_headers () const
 Accessor for received headers.
virtual const std::string & get_header (const std::string &name) const
 Returns a value for the specified header, received from server.
virtual bool connection_successful () const
 Inspect connection attempt results.

Detailed Description

Remote HTTP resource that can be read from as a Source

Member Function Documentation

virtual bool staticlib::http::resource::connection_successful ( ) const
virtual

Inspect connection attempt results.

Returns
'true' if connection has been established successfully and response code has been received, 'false' otherwise
virtual const std::string& staticlib::http::resource::get_header ( const std::string &  name) const
virtual

Returns a value for the specified header, received from server.

Uses linear search over headers array.

Parameters
nameheader name
Returns
header value, empty string if specified header not found
virtual const std::vector<std::pair<std::string, std::string> >& staticlib::http::resource::get_headers ( ) const
virtual

Accessor for received headers.

Returns
received headers
virtual resource_info staticlib::http::resource::get_info ( ) const
virtual

Accessor for the resource metainformation.

Returns
virtual uint16_t staticlib::http::resource::get_status_code ( ) const
virtual

Returns HTTP status code.

Returns
HTTP status code
virtual const std::string& staticlib::http::resource::get_url ( ) const
virtual

Returns URL of this resource.

Returns
URL of this resource
virtual std::streamsize staticlib::http::resource::read ( sl::io::span< char >  span)
virtual

PIMPL-specific constructor.

Parameters
pimplimpl object Reads some data from a remote resource
spanoutput span
Returns
number of bytes processed

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