4D v13.4WEB GET HTTP HEADER |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
WEB GET HTTP HEADER
WEB GET HTTP HEADER
The WEB GET HTTP HEADER command returns either a string or two arrays, containing the HTTP header used for the currently processed request. This command can be called from within any method (On Web Authentication Database Method or On Web Connection Database Method, method called by "/4DACTION"...) executed in a Web process.
"GET /page.html HTTP\1.0"+Char(13)+Char(10)+"User-Agent: browser"+Char(13)+Char(10)+"Cookie: C=HELLO" Each header field is separated by a CR+LF (Carriage return+Line feed) sequence under Windows and Mac OS.
When this syntax is used, the returned results in the fieldArray and valueArray are as follows:
* These first three items are not HTTP fields. They are part of the first line of the request. To comply with the HTTP standard, field names are always written in English. Here is a list of some HTTP fields that can be used in a request:
The following method allows getting any HTTP request header field content: ` Project method GetHTTPField
` Cookie header content
$language:=GetHTTPField("Accept-Language") Note: Web browsers allow defining several languages by default. They are listed in the "Accept-Language" field, separated by a ";". Their priority is defined according to their position within the string; therefore it is a good idea to test language positions in the string.
$host:=GetHTTPField("Host") |
PROPERTIES
Product: 4D
INDEX HISTORY
SEE ALSO
WEB GET HTTP BODY |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||