4D v15WEB GET OPTION and WEB SET OPTION |
||||||||||||||||||||||||||||||||||||||
|
4D v15
WEB GET OPTION and WEB SET OPTION
|
WEB GET OPTION ( selector ; value ) |
||
Originally introduced in 4D v14 R3
A new value is available for the selector parameter of the WEB GET OPTION and WEB SET OPTION commands:
Constant | Type | Value |
Web Session enable IP address validation | Longint | 83 |
A new constant is available in 4D v15 for the selector parameter: Web debug log (84).
This selector allows you to get or set the status of the new HTTP request log file for the 4D Web server. When enabled, this file, named "HTTPDebugLog_nn.txt", is saved in the "Logs" folder of the application (nn is the file number). It is useful for debugging issues related to the Web server. It records each request and each response in raw mode. Whole requests, including headers, are logged; optionally, body parts can be logged as well.
When you pass Web debug log in selector, several value options can be get or set, corresponding to the information you want to log. The following new constants are available in the "Web Server" constant theme:
Constant (value) | Type | Description |
wdl disable (0) | Longint | Web HTTP debug log is disabled |
wdl enable without body (1) | Longint | Web HTTP debug log is enabled without body parts (body size is provided in this case) |
wdl enable with response body (3) | Longint | Web HTTP debug log is enabled with body part in response only |
wdl enable with request body (5) | Longint | Web HTTP debug log is enabled with body part in request only |
wdl enable with all body parts (7) | Longint | Web HTTP debug log is enabled with body parts in response and request |
Note: The HTTP request log file can only be enabled or disabled using the WEB SET OPTION command.
// Disabling IP Address validation
WEB SET OPTION(Web session enable IP address validation;0)
... // specific code
// Enabling IP Address Validation
WEB SET OPTION(Web session enable IP address validation;1)
Enabling the HTTP debug log without body parts:
WEB SET OPTION(Web debug log;wdl enable without body)
A log entry looks like this:
# REQUEST
# SocketID: 1592
# PeerIP: 127.0.0.1
# PeerPort: 54912
# TimeStamp: 39089388
GET /4DWEBTEST HTTP/1.1
Connection: Close
Host: 127.0.0.1
User-Agent: 4D_HTTP_Client/0.0.0.0
# RESPONSE
# SocketID: 1592
# PeerIP: 127.0.0.1
# PeerPort: 54912
# TimeStamp: 39089389 (elapsed time: 1 ms)
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: close
Content-Length: 3555
Content-Type: text/plain; charset=UTF-8
Date: Tue, 20 Jan 2015 10:51:29 GMT
Expires: Tue, 20 Jan 2015 10:51:29 GMT
Pragma: no-cache
Server: 4D/14.6.0
[Body Size: 3555]
Product: 4D
Theme: Language
4D v15 - Upgrade (standard edition) ( 4D v15)
Inherited from : WEB GET OPTION and WEB SET OPTION ( 4D v15)