# pion::http::response_reader Class Reference

`#include <response_reader.hpp>`

Inherits pion::http::reader.

List of all members.

## Public Types

typedef boost::function3< void, http::response_ptr, tcp::connection_ptr, const boost::system::error_code & > | finished_handler_t
| function called after the HTTP message has been parsed

## Public Member Functions

void | set_headers_parsed_callback (finished_handler_t &h)
| sets a function to be called after HTTP headers have been parsed

## Static Public Member Functions

static boost::shared_ptr < response_reader > | create (tcp::connection_ptr &tcp_conn, const http::request &http_request, finished_handler_t handler)

## Protected Member Functions

| response_reader (tcp::connection_ptr &tcp_conn, const http::request &http_request, finished_handler_t handler)
virtual void | read_bytes (void)
| Reads more bytes from the TCP connection.
virtual void | finished_parsing_headers (const boost::system::error_code &ec)
| Called after we have finished parsing the HTTP message headers.
virtual void | finished_reading (const boost::system::error_code &ec)
| Called after we have finished reading/parsing the HTTP message.
virtual http::message & | get_message (void)
| Returns a reference to the HTTP message being parsed.

## Protected Attributes

http::response_ptr | m_http_msg
| The new HTTP message container being created.
finished_handler_t | m_finished
| function called after the HTTP message has been parsed
finished_handler_t | m_parsed_headers
| function called after the HTTP message headers have been parsed

## Detailed Description

response_reader: asynchronously reads and parses HTTP responses

Definition at line 31 of file response_reader.hpp.

## Constructor & Destructor Documentation

pion::http::response_reader::response_reader | ( | tcp::connection_ptr & | tcp_conn,
|  | const http::request & | http_request,
|  | finished_handler_t | handler |
| ) |  |  | `[inline, protected]`

protected constructor restricts creation of objects (use create())

Parameters:

  | tcp_conn | TCP connection containing a new message to parse
  | http_request | the request we are responding to
  | handler | function called after the message has been parsed

Definition at line 74 of file response_reader.hpp.

References m_http_msg, and pion::http::parser::set_logger().

Referenced by create().

## Member Function Documentation

static boost::shared_ptr<response_reader> pion::http::response_reader::create | ( | tcp::connection_ptr & | tcp_conn,
|  | const http::request & | http_request,
|  | finished_handler_t | handler |
| ) |  |  | `[inline, static]`

creates new response_reader objects

Parameters:

  | tcp_conn | TCP connection containing a new message to parse
  | http_request | the request we are responding to
  | handler | function called after the message has been parsed

Definition at line 54 of file response_reader.hpp.

References response_reader().

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

- include/pion/http/response_reader.hpp