indexing
description: "Class which deals with the output header"
date: "$Date$"
revision: "$Revision$"
class interface
CGI_RESPONSE_HEADER
feature
Document_moved_status: INTEGER is 301
CGI_COMMON_STATUS_TYPES
Forbidden_status: INTEGER is 403
CGI_COMMON_STATUS_TYPES
header: STRING
Internal_server_error_status: INTEGER is 500
CGI_COMMON_STATUS_TYPES
is_complete_header: BOOLEAN
is_sent: BOOLEAN
No_response_status: INTEGER is 204
CGI_COMMON_STATUS_TYPES
Not_found_status: INTEGER is 404
CGI_COMMON_STATUS_TYPES
Not_implemented_status: INTEGER is 501
CGI_COMMON_STATUS_TYPES
output: STDOUT
CGI_IN_AND_OUT
response_header: CGI_RESPONSE_HEADER
CGI_IN_AND_OUT
stdin: STDIN
CGI_IN_AND_OUT
Success_status: INTEGER is 200
CGI_COMMON_STATUS_TYPES
Unauthorized_status: INTEGER is 401
CGI_COMMON_STATUS_TYPES
feature
set_cookie (key, value, expiration, path, domain, secure: STRING)
require
not_yet_sent: not is_sent
make_sense: (key /= void and value /= void) and then (not key.is_empty and not value.is_empty)
header_exists: header /= void
header_is_complete: is_complete_header
set_expiration (a_date: STRING)
require
not_yet_sent: not is_sent
date_exists: a_date /= void
header_exists: header /= void
header_is_complete: is_complete_header
set_pragma (a_pragma: STRING)
require
not_yet_sent: not is_sent
pragma_exists: a_pragma /= void
header_exists: header /= void
header_is_complete: is_complete_header
feature
generate_http_redirection (an_url: STRING; is_secure: BOOLEAN)
require
not_yet_sent: not is_sent
url_not_void_and_not_empty: an_url /= void and then not an_url.is_empty
header_void: header = void
generate_text_header
HTML
require
header_void: header = void
not_yet_sent: not is_sent
reinitialize_header
require
not_yet_sent: not is_sent
ensure
reinitialized: header = void and not is_complete_header and not is_sent
return_status (a_status: INTEGER; a_message: STRING)
CGI_COMMON_STATUS_TYPES
require
not_yet_sent: not is_sent
message_exists: a_message /= void
header_void: header /= void
send_to_browser
require
header_exists: header /= void
not_yet_sent: not is_sent
ensure
header_sent: is_sent
invariant
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
end -- CGI_RESPONSE_HEADER