Update library/protocol/CONNEG/README.md

This commit is contained in:
jvelilla
2011-12-01 09:34:11 -02:00
parent f71bbc07e8
commit 3b30f4b994

View File

@@ -13,22 +13,21 @@ The class CONNEG_SERVER_SIDE contains several features that helps to write diffe
charset and compression).
So for each of the following questions, you will have a corresponding method to help in the solution.
How to implement Media type negotiation?
Hint: Use CONNEG_SERVER_SIDE.media_type_preference
- How to implement Media type negotiation?
Hint: Use CONNEG_SERVER_SIDE.media_type_preference
How to implement Language Negotiation?
Hint: Use CONNEG_SERVER_SIDE.language_preference
- How to implement Language Negotiation?
Hint: Use CONNEG_SERVER_SIDE.language_preference
- How to implement Character encoding Negotiation?
Hint: Use CONNEG_SERVER_SIDE.charset_preference
How to implement Character encoding Negotiation?
Hint: Use CONNEG_SERVER_SIDE.charset_preference
How to implement Compression Negotiation?
Hint: Use CONNEG_SERVER_SIDE.encoding_preference
- How to implement Compression Negotiation?
Hint: Use CONNEG_SERVER_SIDE.encoding_preference
There is also a test case where you can check how to use this class.
note
note
description: "Summary description for CONNEG_SERVER_SIDE. Utility class to support Server Side Content Negotiation "
author: ""
date: "$Date$"
@@ -43,17 +42,17 @@ note
In order to improve the server's guess, the user agent MAY include request header fields (Accept, Accept-Language, Accept-Encoding, etc.) which describe its preferences for such a response.
]"
class interface
class interface
CONNEG_SERVER_SIDE
create
create
make
feature -- Initialization
feature -- Initialization
make (a_mime: STRING_8; a_language: STRING_8; a_charset: STRING_8; an_encoding: STRING_8)
feature -- Compression Negotiation
feature -- Compression Negotiation
encoding_preference (server_encoding_supported: LIST [STRING_8]; header: STRING_8): COMPRESSION_VARIANT_RESULTS
-- server_encoding_supported represent a list of encoding supported by the server.
@@ -62,7 +61,7 @@ feature -- Compression Negotiation
-- one Encoding, or empty in other case.
-- Representation: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
feature -- Encoding Negotiation
feature -- Encoding Negotiation
charset_preference (server_charset_supported: LIST [STRING_8]; header: STRING_8): CHARACTER_ENCODING_VARIANT_RESULTS
-- server_charset_supported represent a list of charset supported by the server.
@@ -71,7 +70,7 @@ feature -- Encoding Negotiation
-- one Charset, or empty in other case.
-- Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2
feature -- Language Negotiation
feature -- Language Negotiation
language_preference (server_language_supported: LIST [STRING_8]; header: STRING_8): LANGUAGE_VARIANT_RESULTS
-- server_language_supported represent a list of languages supported by the server.
@@ -80,7 +79,7 @@ feature -- Language Negotiation
-- one Language, or empty in other case.
-- Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
feature -- Media Type Negotiation
feature -- Media Type Negotiation
media_type_preference (mime_types_supported: LIST [STRING_8]; header: STRING_8): MEDIA_TYPE_VARIANT_RESULTS
-- mime_types_supported represent media types supported by the server.
@@ -89,7 +88,7 @@ feature -- Media Type Negotiation
-- one media type, or empty in other case.
-- Reference : http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
feature -- Server Side Defaults Formats
feature -- Server Side Defaults Formats
charset_default: STRING_8
@@ -118,9 +117,9 @@ feature -- Server Side Defaults Formats
ensure
set_mime_default: a_mime ~ mime_default
note
note
copyright: "2011-2011, Javier Velilla, Jocelyn Fiat and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end -- class CONNEG_SERVER_SIDE
end -- class CONNEG_SERVER_SIDE