Use HTTP_HEADER instead of WSF_HEADER

(WSF_HEADER is kept for convenience and existing code)
This commit is contained in:
Jocelyn Fiat
2011-11-25 15:53:15 +01:00
parent 48d4d26cda
commit 42be0b2a4e
12 changed files with 29 additions and 27 deletions

View File

@@ -31,7 +31,7 @@ feature {NONE} -- Initialization
feature -- Access feature -- Access
headers: WSF_HEADER headers: HTTP_HEADER
feature -- Recycle feature -- Recycle

View File

@@ -32,7 +32,7 @@ feature -- Recycle
feature -- Access feature -- Access
headers: WSF_HEADER headers: HTTP_HEADER
api: STRING api: STRING
-- Associated api query string. -- Associated api query string.

View File

@@ -55,7 +55,7 @@ feature -- Execution
execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE) execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
l_full: BOOLEAN l_full: BOOLEAN
h: WSF_HEADER h: HTTP_HEADER
l_login: STRING_8 l_login: STRING_8
s: STRING s: STRING
content_type_supported: ARRAY [STRING] content_type_supported: ARRAY [STRING]

View File

@@ -42,7 +42,7 @@ feature -- Execution
-- Execute request handler -- Execute request handler
local local
s: STRING s: STRING
h: WSF_HEADER h: HTTP_HEADER
do do
create h.make create h.make
h.put_content_type_text_plain h.put_content_type_text_plain

View File

@@ -78,7 +78,7 @@ feature -- Execution
local local
rqst_uri: detachable STRING rqst_uri: detachable STRING
l_path_info: detachable STRING l_path_info: detachable STRING
h: WSF_HEADER h: HTTP_HEADER
s: STRING s: STRING
l_redir_url: STRING l_redir_url: STRING
do do
@@ -108,7 +108,7 @@ feature -- Implementation
-- execute_exception_trace (ctx: like new_request_context) -- execute_exception_trace (ctx: like new_request_context)
-- local -- local
-- h: WSF_HEADER -- h: HTTP_HEADER
-- s: STRING -- s: STRING
-- do -- do
-- create h.make -- create h.make

View File

@@ -84,7 +84,7 @@ feature -- Execution
execute_default (req: WSF_REQUEST; res: WSF_RESPONSE) execute_default (req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h: WSF_HEADER h: HTTP_HEADER
l_url: STRING l_url: STRING
e: EXECUTION_ENVIRONMENT e: EXECUTION_ENVIRONMENT
n: INTEGER n: INTEGER
@@ -171,7 +171,7 @@ feature -- Execution
execute_hello (req: WSF_REQUEST; res: WSF_RESPONSE; a_name: detachable READABLE_STRING_32; ctx: REQUEST_HANDLER_CONTEXT) execute_hello (req: WSF_REQUEST; res: WSF_RESPONSE; a_name: detachable READABLE_STRING_32; ctx: REQUEST_HANDLER_CONTEXT)
local local
l_response_content_type: detachable STRING l_response_content_type: detachable STRING
h: WSF_HEADER h: HTTP_HEADER
content_type_supported: ARRAY [STRING] content_type_supported: ARRAY [STRING]
l_body: STRING_8 l_body: STRING_8
do do

View File

@@ -76,7 +76,7 @@ feature -- HTTP Methods
compute_response_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) compute_response_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER)
local local
h: WSF_HEADER h: HTTP_HEADER
l_msg : STRING l_msg : STRING
etag_utils : ETAG_UTILS etag_utils : ETAG_UTILS
do do
@@ -152,7 +152,7 @@ feature -- HTTP Methods
compute_response_put (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) compute_response_put (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER)
local local
h: WSF_HEADER h: HTTP_HEADER
joc : JSON_ORDER_CONVERTER joc : JSON_ORDER_CONVERTER
etag_utils : ETAG_UTILS etag_utils : ETAG_UTILS
do do
@@ -205,7 +205,7 @@ feature -- HTTP Methods
compute_response_delete (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) compute_response_delete (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.no_content) h.put_status ({HTTP_STATUS_CODE}.no_content)
@@ -241,7 +241,7 @@ feature -- HTTP Methods
compute_response_post (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) compute_response_post (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER)
local local
h: WSF_HEADER h: HTTP_HEADER
l_msg : STRING l_msg : STRING
l_location : STRING l_location : STRING
joc : JSON_ORDER_CONVERTER joc : JSON_ORDER_CONVERTER

View File

@@ -48,7 +48,7 @@ feature -- Execution
-- in the case that the given uri does not have a corresponding http method -- in the case that the given uri does not have a corresponding http method
-- to handle it. -- to handle it.
local local
h : WSF_HEADER h : HTTP_HEADER
l_description : STRING l_description : STRING
l_api_doc : STRING l_api_doc : STRING
do do

View File

@@ -169,7 +169,7 @@ feature -- Handle responses
handle_bad_request_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) handle_bad_request_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE )
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.bad_request) h.put_status ({HTTP_STATUS_CODE}.bad_request)
@@ -184,7 +184,7 @@ feature -- Handle responses
handle_precondition_fail_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) handle_precondition_fail_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE )
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.precondition_failed) h.put_status ({HTTP_STATUS_CODE}.precondition_failed)
@@ -198,7 +198,7 @@ feature -- Handle responses
handle_internal_server_error (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) handle_internal_server_error (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE )
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.internal_server_error) h.put_status ({HTTP_STATUS_CODE}.internal_server_error)
@@ -212,7 +212,7 @@ feature -- Handle responses
handle_not_implemented (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE ) handle_not_implemented (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE )
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.not_implemented) h.put_status ({HTTP_STATUS_CODE}.not_implemented)
@@ -226,7 +226,7 @@ feature -- Handle responses
handle_method_not_allowed_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) handle_method_not_allowed_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.method_not_allowed) h.put_status ({HTTP_STATUS_CODE}.method_not_allowed)
@@ -240,7 +240,7 @@ feature -- Handle responses
handle_resource_not_found_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) handle_resource_not_found_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.not_found) h.put_status ({HTTP_STATUS_CODE}.not_found)
@@ -255,7 +255,7 @@ feature -- Handle responses
handle_resource_not_modified_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) handle_resource_not_modified_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h : WSF_HEADER h : HTTP_HEADER
do do
res.flush res.flush
create h.make create h.make
@@ -271,7 +271,7 @@ feature -- Handle responses
handle_resource_conflict_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) handle_resource_conflict_response (a_description: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h : WSF_HEADER h : HTTP_HEADER
do do
create h.make create h.make
h.put_status ({HTTP_STATUS_CODE}.conflict) h.put_status ({HTTP_STATUS_CODE}.conflict)

View File

@@ -48,7 +48,7 @@ feature -- Execution
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute request handler -- Execute request handler
local local
h: WSF_HEADER h: HTTP_HEADER
s: STRING s: STRING
uri: STRING uri: STRING
do do
@@ -92,7 +92,7 @@ feature -- Execution
respond_index (a_uri: READABLE_STRING_8; dn: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) respond_index (a_uri: READABLE_STRING_8; dn: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h: WSF_HEADER h: HTTP_HEADER
uri, s: STRING_8 uri, s: STRING_8
d: DIRECTORY d: DIRECTORY
l_files: LIST [STRING_8] l_files: LIST [STRING_8]
@@ -148,7 +148,7 @@ feature -- Execution
respond_file (f: FILE; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) respond_file (f: FILE; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
fn: READABLE_STRING_8 fn: READABLE_STRING_8
h: WSF_HEADER h: HTTP_HEADER
ext: READABLE_STRING_8 ext: READABLE_STRING_8
ct: detachable READABLE_STRING_8 ct: detachable READABLE_STRING_8
do do
@@ -177,7 +177,7 @@ feature -- Execution
respond_not_found (uri: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) respond_not_found (uri: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h: WSF_HEADER h: HTTP_HEADER
s: STRING_8 s: STRING_8
do do
create h.make create h.make
@@ -193,7 +193,7 @@ feature -- Execution
respond_access_denied (uri: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE) respond_access_denied (uri: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
h: WSF_HEADER h: HTTP_HEADER
s: STRING_8 s: STRING_8
do do
create h.make create h.make

View File

@@ -22,6 +22,8 @@ note
class class
WSF_HEADER WSF_HEADER
obsolete "Use HTTP_HEADER [2011-nov-25]"
inherit inherit
HTTP_HEADER HTTP_HEADER

View File

@@ -91,7 +91,7 @@ feature -- Header output operation
status_not_set: not status_is_set status_not_set: not status_is_set
header_not_committed: not header_committed header_not_committed: not header_committed
local local
h: WSF_HEADER h: HTTP_HEADER
i,n: INTEGER i,n: INTEGER
do do
set_status_code (a_status_code) set_status_code (a_status_code)