note description : "Basic Service that Read Request Headers" date : "$Date$" revision : "$Revision$" class APPLICATION inherit WSF_DEFAULT_SERVICE redefine initialize end create make_and_launch feature {NONE} -- Initialization initialize -- Initialize current service. do set_service_option ("port", 9090) set_service_option ("verbose", true) end feature -- Basic operations execute (req: WSF_REQUEST; res: WSF_RESPONSE) -- Execute the incomming request local l_raw_data: STRING l_page_response: STRING l_rows: STRING do create l_page_response.make_from_string (html_template) if req.path_info.same_string ("/") then -- HTTP method l_page_response.replace_substring_all ("$http_method", req.request_method) -- URI l_page_response.replace_substring_all ("$uri", req.path_info) -- Protocol l_page_response.replace_substring_all ("$protocol", req.server_protocol) -- Fill the table rows with HTTP Headers create l_rows.make_empty across req.meta_variables as ic loop if ic.item.name.starts_with ("HTTP_") then l_rows.append ("
| Header Name | Header Value |
|---|