From a2a1883e04aaa923b385cbbc496395ed5bf1dc17 Mon Sep 17 00:00:00 2001 From: tmanevik Date: Mon, 6 Jul 2015 21:21:27 +0200 Subject: Inets Reference Manual Editorial changes --- lib/inets/doc/src/httpd_util.xml | 177 +++++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 82 deletions(-) (limited to 'lib/inets/doc/src/httpd_util.xml') diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml index a48e141368..439a01877f 100644 --- a/lib/inets/doc/src/httpd_util.xml +++ b/lib/inets/doc/src/httpd_util.xml @@ -30,9 +30,10 @@ httpd_util.sgml httpd_util - Miscellaneous utility functions to be used when implementing Erlang Web server API modules. + Miscellaneous utility functions to be used when implementing + Erlang web server API modules. -

This module provides the Erlang Web Server API module +

This module provides the Erlang web server API module programmer with miscellaneous utility functions.

@@ -41,7 +42,7 @@ convert_request_date(DateString) -> ErlDate|bad_date - Convert The the date to the Erlang date format. + Converts the date to the Erlang date format. DateString = string() ErlDate = {{Year,Month,Date},{Hour,Min,Sec}} @@ -49,8 +50,9 @@

convert_request_date/1 converts DateString to - the Erlang date format. DateString must be in one of the three - date formats that is defined in the RFC 2616.

+ the Erlang date format. DateString must be in one of the + three date formats defined in + RFC 2616.

@@ -64,9 +66,9 @@ Etag = string() -

create_etag/1 calculates the Etag for a file, from its - size and time for last modification. fileinfo is a record defined - in kernel/include/file.hrl

+

create_etag/1 calculates the Etag for a file from its + size and time for last modification. FileInfo is a record defined + in kernel/include/file.hrl.

@@ -74,7 +76,7 @@ decode_hex(HexValue) -> DecValue - Convert a hex value into its decimal equivalent. + Converts a hexadecimal value into its decimal equivalent. HexValue = DecValue = string() @@ -88,7 +90,8 @@ day(NthDayOfWeek) -> DayOfWeek - Convert the day of the week (integer [1-7]) to an abbreviated string. + Converts the day of the week + (integer [1-7]) to an abbreviated string. NthDayOfWeek = 1-7 DayOfWeek = string() @@ -96,8 +99,8 @@

day/1 converts the day of the week - (NthDayOfWeek) as an integer (1-7) to an abbreviated - string, that is:

+ (NthDayOfWeek) from an integer (1-7) to an abbreviated + string, that is:

1 = "Mon", 2 = "Tue", ..., 7 = "Sat".

@@ -106,7 +109,7 @@ flatlength(NestedList) -> Size - Compute the size of a possibly nested list. + Computes the size of a possibly nested list. NestedList = list() Size = integer() @@ -114,7 +117,7 @@

flatlength/1 computes the size of the possibly nested - list NestedList. Which may contain binaries.

+ list NestedList, which can contain binaries.

@@ -126,7 +129,7 @@ header(StatusCode,Date) header(StatusCode,MimeType,Date) header(StatusCode,MimeType,PersistentConn,Date) -> HTTPHeader - Generate a HTTP 1.1 header. + Generates an HTTP 1.1 header. StatusCode = integer() Date = rfc1123_date() @@ -135,15 +138,16 @@ -

header returns a HTTP 1.1 header string. The - StatusCode is one of the status codes defined in RFC - 2616 and the Date string is RFC 1123 - compliant. (See rfc1123_date/0). +

header returns an HTTP 1.1 header string. + StatusCode is one of the status codes defined in + RFC 2616 + and the Date string is RFC 1123 + compliant (see rfc1123_date/0).

-

Note that the two version of header/n that does not - has a PersistentConn argument is there only for - backward compatibility, and must not be used in new Erlang - Webserver API modules. that will support persistent +

Notice that the two versions of header/n that does not + have a PersistentConn argument is only for + backward compatibility and must not be used in new Erlang + web server API modules supporting persistent connections.

@@ -153,14 +157,14 @@ hexlist_to_integer(HexString) -> Number - Convert a hexadecimal string to an integer. + Converts a hexadecimal string to an integer. Number = integer() HexString = string() -

hexlist_to_integer Convert the Hexadecimal value of - HexString to an integer.

+

hexlist_to_integer converts the hexadecimal value of + HexString to an integer.

@@ -168,15 +172,15 @@ integer_to_hexlist(Number) -> HexString - Convert an integer to a hexadecimal string. + Converts an integer to a hexadecimal string. Number = integer() HexString = string() -

integer_to_hexlist/1 Returns a string that represents - the Number in a Hexadecimal form.

+

integer_to_hexlist/1 returns a string representing + Number in a hexadecimal form.

@@ -185,7 +189,8 @@ lookup(ETSTable,Key) -> Result lookup(ETSTable,Key,Undefined) -> Result - Extract the first value associated with a key in an ETS table. + Extracts the first value associated with a Key + in an ETS table. ETSTable = ets_table() Key = term() @@ -195,7 +200,7 @@

lookup extracts {Key,Value} tuples from ETSTable and returns the Value associated - with Key. If ETSTable is of type bag + with Key. If ETSTable is of type bag, only the first Value associated with Key is returned. lookup/2 returns undefined and lookup/3 returns Undefined if no Value @@ -208,7 +213,7 @@ lookup_mime(ConfigDB,Suffix) lookup_mime(ConfigDB,Suffix,Undefined) -> MimeType - Return the mime type associated with a specific file suffix. + Returns the MIME type associated with a specific file suffix. ConfigDB = ets_table() Suffix = string() @@ -217,10 +222,11 @@ -

lookup_mime returns the mime type associated with a - specific file suffix as specified in the mime.types - file (located in the - config directory).

+

lookup_mime returns the MIME type associated with a + specific file suffix as specified in the file mime.types + (located in the + + config directory).

@@ -229,7 +235,8 @@ lookup_mime_default(ConfigDB,Suffix) lookup_mime_default(ConfigDB,Suffix,Undefined) -> MimeType - Return the mime type associated with a specific file suffix or the value of the DefaultType. + Returns the MIME type associated with a specific file suffix + or the value of the DefaultType. ConfigDB = ets_table() Suffix = string() @@ -238,12 +245,12 @@ -

lookup_mime_default returns the mime type associated +

lookup_mime_default returns the MIME type associated with a specific file suffix as specified in the mime.types file (located in the - config directory). - If no appropriate association can be found - the value of DefaultType is + + config directory). + If no appropriate association is found, the value of DefaultType is returned.

@@ -252,7 +259,7 @@ message(StatusCode,PhraseArgs,ConfigDB) -> Message - Return an informative HTTP 1.1 status string in HTML. + Returns an informative HTTP 1.1 status string in HTML. StatusCode = 301 | 400 | 403 | 404 | 500 | 501 | 504 PhraseArgs = term() @@ -267,20 +274,21 @@

301 - string(): A URL pointing at the new document - position. +

string(): A URL pointing at the new document + position.

400 | 401 | 500 - none (No PhraseArgs) +

none (no PhraseArgs).

403 | 404 - string(): A Request-URI as described in - RFC 2616. +

string(): A Request-URI as described in + RFC 2616.

+
501 - {Method,RequestURI,HTTPVersion}: The HTTP - Method, Request-URI and HTTP-Version - as defined in RFC 2616. +

{Method,RequestURI,HTTPVersion}: The HTTP + Method, Request-URI, and HTTP-Version + as defined in RFC 2616.

504 - string(): A string describing why the service - was unavailable. +

string(): A string describing why the service + was unavailable.

@@ -289,7 +297,7 @@ month(NthMonth) -> Month - Convert the month as an integer (1-12) to an abbreviated string. + Converts the month as an integer (1-12) to an abbreviated string. NthMonth = 1-12 Month = string() @@ -306,7 +314,7 @@ multi_lookup(ETSTable,Key) -> Result - Extract the values associated with a key in a ETS table. + Extracts the values associated with a key in an ETS table. ETSTable = ets_table() Key = term() @@ -314,7 +322,8 @@

multi_lookup extracts all {Key,Value} tuples - from an ETSTable and returns allValues associated with the Key in a list.

+ from an ETSTable and returns all Values + associated with Key in a list.

@@ -322,16 +331,16 @@ reason_phrase(StatusCode) -> Description - Return the description of an HTTP 1.1 status code. + Returns the description of an HTTP 1.1 status code. - StatusCode = 100| 200 | 201 | 202 | 204 | 205 | 206 | 300 | 301 | 302 | 303 | 304 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 410 411 | 412 | 413 | 414 415 | 416 | 417 | 500 | 501 | 502 | 503 | 504 | 505 + StatusCode = 100| 200 | 201 | 202 | 204 | 205 | 206 | 300 | 301 | 302 | 303 | 304 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 410 411 | 412 | 413 | 414 415 | 416 | 417 | 500 | 501 | 502 | 503 | 504 | 505 Description = string() -

reason_phrase returns the Description of an - HTTP 1.1 StatusCode, for example 200 is "OK" and 201 - is "Created". Read RFC 2616 for further information.

- +

reason_phrase returns Description of an + HTTP 1.1 StatusCode, for example, 200 is "OK" and 201 + is "Created". For more information, see + RFC 2616.

@@ -339,7 +348,7 @@ rfc1123_date() -> RFC1123Date rfc1123_date({{YYYY,MM,DD},{Hour,Min,Sec}}) -> RFC1123Date - Return the current date in RFC 1123 format. + Returns the current date in RFC 1123 format. YYYY = MM = DD = Hour = Min = Sec = integer() RFC1123Date = string() @@ -356,7 +365,7 @@ split(String,RegExp,N) -> SplitRes - Split a string in N chunks using a regular expression. + Splits a string in N chunks using a regular expression. String = RegExp = string() SplitRes = {ok, FieldList} | {error, errordesc()} @@ -365,10 +374,10 @@ -

split/3 splits the String in N chunks - using the RegExp. split/3 is is equivalent to - regexp:split/2 with one exception, that is N - defines the number of maximum number of fields in the +

split/3 splits String in N chunks + using RegExp. split/3 is equivalent to + regexp:split/2 with the exception that N + defines the maximum number of fields in FieldList.

@@ -377,7 +386,8 @@ split_script_path(RequestLine) -> Splitted - Split a RequestLinein a file reference to an executable and aQueryStringor a PathInfostring. + Splits a RequestLine in a file reference to an executable, + and a QueryString or a PathInfostring. RequestLine = string() Splitted = not_a_script | {Path, PathInfo, QueryString} @@ -387,8 +397,8 @@

split_script_path/1 is equivalent to split_path/1 with one exception. If the longest - possible path is not a regular, accessible and executable - file not_a_script is returned.

+ possible path is not a regular, accessible, and executable + file, then not_a_script is returned.

@@ -396,20 +406,22 @@ split_path(RequestLine) -> {Path,QueryStringOrPathInfo} - Split a RequestLinein a file reference and a QueryStringor aPathInfostring. + Splits a RequestLine in a file reference, and a + QueryString or a PathInfo string. RequestLine = Path = QueryStringOrPathInfo = string() -

split_path/1 splits the RequestLine in a file - reference (Path) and a QueryString or a - PathInfo string as specified in RFC 2616. A - QueryString is isolated from the Path with a +

split_path/1 splits RequestLine in a file + reference (Path), and a QueryString or a + PathInfo string as specified in + RFC 2616. + A QueryString is isolated from Path with a question mark (?) and PathInfo with a slash (/). In the case of a QueryString, everything before - the ? is a Path and everything after a - QueryString. In the case of a PathInfo the + ? is a Path and everything after ? is a + QueryString. In the case of a PathInfo, RequestLine is scanned from left-to-right on the hunt for longest possible Path being a file or a directory. Everything after the longest possible @@ -423,14 +435,15 @@ strip(String) -> Stripped - Returns String where the leading and trailing space and tabs has been removed. + Returns String where the leading and trailing space + tabs are removed. String = Stripped = string()

strip/1 removes any leading or trailing linear white - space from the string. Linear white space should be read as + space from the string. Linear white space is to be read as horizontal tab or space.

@@ -439,15 +452,15 @@ suffix(FileName) -> Suffix - Extract the file suffix from a given filename. + Extracts the file suffix from a given filename. FileName = Suffix = string()

suffix/1 is equivalent to - filename:extension/1 with one exception, that is - Suffix is returned without a leading dot (.).

+ filename:extension/1 with the exception that + Suffix is returned without a leading dot (.).

-- cgit v1.2.3