## Class reply

zeep::http::reply — the class containing all to generate a HTTP reply

## Synopsis

    // In header: <zeep/http/reply.hpp>

    class reply {
    public:
      // types
      typedef header ;

      // construct/copy/destruct
      ( = ,  = { );
      (, , header > &&,
            );
      (reply &);
      (reply &&);
      reply & (reply &);
      reply & (reply &&);
      ~();

      // friend functions
       (, reply &);

      // public member functions
       ();
       (, );
       ();
       (, );
       () ;
       ();
       (, ,
                      cookie_directive > = {});
       ();
       () ;
       () ;
       ();
       (xml::document &);
       (xml::element &);
       (json::element &);
       (, );
       (, , );
       (, );
       () ;
       () ;
       ();
       ();
       () ;
       () ;
       () ;

      // public static functions
      reply ();
      reply (, );
      reply ();
      reply (, );
    };

## Description

Create a HTTP reply, should be either HTTP 1.0 or 1.1

### `reply` public construct/copy/destruct

1.     ( status = ,  version = { );

   Create a reply, default is HTTP 1.0. Use 1.1 if you want to use keep alive e.g.

2.     ( status,  version,
             header > && headers,  payload);

3.     (reply & rhs);

4.     (reply && rhs);

5.     reply & (reply &);

6.     reply & (reply &&);

7.     ~();

### `reply` friend functions

1.      ( os, reply & rep);

   for debugging

### `reply` public member functions

1.      ();

2.      ( version_major,  version_minor);

3.      ( version);

4.      ( name,  value);

   Add a header with name name and value value.

5.      ( name) ;

   Return the value of the header with name name.

6.      ( name);

   Remove the header with name name from the list of headers.

7.      ( name,  value,
                       cookie_directive > directives = {});

   Set a cookie.

8.      ( name);

   Set a header to delete the name cookie.

9.      ( name) ;

   Get a cookie.

10.      () ;

11.      ( type);

12.      (xml::document & doc);

    Set the content and the content-type header depending on the content of doc (might be xhtml)

13.      (xml::element & data);

    Set the content and the content-type header to text/xml.

14.      (json::element & json);

    Set the content and the content-type header based on JSON data.

15.      ( data,  contentType);

    Set the content and the content-type header.

16.      ( data,  size,
                          contentType);

    Set the content by copying data and the content-type header.

17.      ( data,  contentType);

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

18.      () ;

    return the content, only useful if the content was set with some constant string data.

19.      () ;

    return the content of the reply as an array of boost::asio::const_buffer objects

20.      ();

    for istream data, if the returned buffer array is empty, the data is done

21.      ( status);

22.      () ;

23.      () ;

    return the size of the reply, only correct if the reply is fully memory based (no streams)

24.      () ;

    Return true if the content will be sent chunked encoded.

### `reply` public static functions

1.     reply ( inStatus);

   Create a standard reply based on a HTTP status code.

2.     reply ( inStatus,  info);

3.     reply ( location);

   Create a standard redirect reply with the specified location.

4.     reply ( location,  status);