3 //=============================================================================
5 * @file HTTP_Response.h
9 //=============================================================================
12 #ifndef HTTP_RESPONSE_H
13 #define HTTP_RESPONSE_H
19 * @class HTTP_Response
21 * @brief Abstraction for HTTP responses.
23 * Provides an encapsulation of responses to HTTP requests.
24 * For instance, given an HTTP GET request, it will produce
25 * header and body suitable for returning to the client who made
31 HTTP_Response (JAWS_IO
&io
,
32 HTTP_Request
&request
);
33 HTTP_Response (HTTP_Request
&request
, JAWS_IO
&io
);
36 /// This is called by the handler to initiate a response.
37 void process_request ();
39 /// This returns an error response for cases where there is a problem
40 /// with the request, logging the log_message.
41 void error_response (int status
,
42 const char *log_message
);
45 /// Called by process_request when the request is a normal request.
46 void normal_response ();
48 /// Called by process_request when the request is a cgi request.
52 /// static version of process_request, just in case.
53 static void process_request (HTTP_Response
&response
);
55 /// creates the appropriate header information for responses.
56 void build_headers ();
59 /// The IO and Request objects associated with this re
61 HTTP_Request
&request_
;
63 #if defined (ACE_JAWS_BASELINE)
66 const char *HTTP_HEADER
;
68 /// HTTP Headers and trailers.
69 const char *HTTP_TRAILER
;
70 int HTTP_HEADER_LENGTH
;
71 int HTTP_TRAILER_LENGTH
;
74 #endif /* HTTP_RESPONSE_H */