PrevUpHomeNext

Class reply

zeep::http::reply

Synopsis

// In header: </home/maarten/projects/libzeep/zeep/http/reply.hpp>


class reply {
public:
  // construct/copy/destruct
  reply(int = 1, int = 0);
  reply(const reply &);
  reply& operator=(const reply &);

  // public member functions
  void set_version(int, int);
  void set_header(const std::string &, const std::string &);
  std::string get_content_type() const;
  void set_content_type(const std::string &);
  void set_content(xml::document &);
  void set_content(xml::element *);
  void set_content(const std::string &, const std::string &);
  void set_content(std::istream *, const std::string &);
  void to_buffers(std::vector< boost::asio::const_buffer > &);
  bool data_to_buffers(std::vector< boost::asio::const_buffer > &);
  std::string get_as_text();
  std::size_t get_size() const;
  status_type get_status() const;

  // public static functions
  static reply stock_reply(status_type);
  static reply redirect(const std::string &);
};

Description

reply public construct/copy/destruct

  1. reply(int version_major = 1, int version_minor = 0);
    Create a reply, default is HTTP 1.0. Use 1.1 if you want to use keep alive e.g.
  2. reply(const reply &);
  3. reply& operator=(const reply &);

reply public member functions

  1. void set_version(int version_major, int version_minor);
  2. void set_header(const std::string & name, const std::string & value);
    Add a header with name name and value value.
  3. std::string get_content_type() const;
  4. void set_content_type(const std::string & type);
    Set the Content-Type header.
  5. void set_content(xml::document & doc);
    Set the content and the content-type header.
  6. void set_content(xml::element * data);
    Set the content and the content-type header.
  7. void set_content(const std::string & data, const std::string & contentType);
    Set the content and the content-type header.
  8. void set_content(std::istream * data, const std::string & contentType);

    To send a stream of data, with unknown size (using chunked transfer). reply takes ownership of data and deletes it when done.

  9. void to_buffers(std::vector< boost::asio::const_buffer > & buffers);
  10. bool data_to_buffers(std::vector< boost::asio::const_buffer > & buffers);
    for istream data, continues until data_to_buffers returns false
  11. std::string get_as_text();
    For debugging purposes.
  12. std::size_t get_size() const;
  13. status_type get_status() const;

reply public static functions

  1. static reply stock_reply(status_type inStatus);
    Create a standard reply based on a HTTP status code.
  2. static reply redirect(const std::string & location);
    Create a standard redirect reply with the specified location.

PrevUpHomeNext