2 * @file HTTP_Response.h
4 * @author Martin Corino <mcorino@remedy.nl>
7 #ifndef ACE_HTTP_RESPONSE_H
8 #define ACE_HTTP_RESPONSE_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/Containers_T.h"
19 #include "ace/INet/INet_Export.h"
20 #include "ace/INet/Response.h"
21 #include "ace/INet/HTTP_Header.h"
22 #include "ace/INet/HTTP_Status.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 * @class ACE_HTTP_Response
33 * @brief Encapsulates HTTP response message properties.
36 class ACE_INET_Export Response
37 : public ACE::INet::Response
, public Header
43 Response(const Status
& status
);
45 Response(const ACE_CString
& version
, const Status
& status
= Status());
50 /// Reset the response object
53 void reset (const Status
& status
);
55 void reset (const ACE_CString
& version
, const Status
& status
= Status());
58 void set_status(const Status
& status
);
60 /// Return the status.
61 const Status
& get_status() const;
63 /// Adds a Cookie header.
64 void add_cookie(const ACE_CString
& cookie
);
66 /// Get cookies from Cookie header(s)).
67 void get_cookies(ACE_Array
<ACE_CString
> & cookies
) const;
69 /// Writes the HTTP response to the given stream
70 virtual void write(std::ostream
& str
) const;
72 /// Reads the HTTP response from the
74 /// 100 Continue responses are ignored.
75 virtual bool read(std::istream
& str
);
77 static const ACE_CString COOKIE
;
82 MAX_VERSION_LENGTH
= 8,
83 MAX_STATUS_LENGTH
= 3,
84 MAX_REASON_LENGTH
= 512
92 ACE_END_VERSIONED_NAMESPACE_DECL
94 #if defined (__ACE_INLINE__)
95 #include "ace/INet/HTTP_Response.inl"
98 #include /**/ "ace/post.h"
99 #endif /* ACE_HTTP_RESPONSE_H */