This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
HTTP SET OPTION

HTTP SET OPTION 


 

HTTP SET OPTION ( option ; value ) 
Parameter Type   Description
option  Longint in Code of option to set
value  Longint in Value of option

The HTTP SET OPTION command sets different options that are used during the next HTTP request triggered by the HTTP Get or HTTP Request commands. You call this command as many times as there are options to set.

Note: Options set are local to the current process. For components, they are local to the component being executed.  . 

In the option parameter, pass the number of the option to be set and in the value parameter, pass the new value of this option. For the option parameter, you can use one of the following predefined constants, available in the HTTP Client theme:

Constant Type Value Comment
HTTP client log Longint 7

value = one of the following constants:

  • HTTP disable log: HTTP client debug log is disabled (default)
  • HTTP enable log with all body parts: HTTP client debug log is enabled with body parts in response and request
  • HTTP enable log with request body: HTTP client debug log is enabled with body part in request only
  • HTTP enable log with response body: HTTP client debug log is enabled with body part in response only
  • HTTP enable log without body: HTTP client debug log is enabled without body parts (body size is provided in this case)

Allows you to get or set the status of the HTTP client request log file. When enabled, this file, named "4DHTTPClientLog_nn.txt", is stored in the "Logs" folder of the application (nn is the file number). It is useful for debugging issues related to the HTTP client requests. It records each request and each response in raw mode. Whole requests, including headers, are logged; optionally, body parts can be logged as well. For more information, please refer to the Description of log files section.

HTTP compression Longint 6 value = 0 (do not compress) or 1 (compress). Default value: 0
This option enables or disables the compression mechanism intended to accelerate exchanges for requests between the client and server. When this mechanism is enabled, the HTTP client uses deflate or gzip compression depending on the server response.
HTTP display auth dial Longint 4 value = 0 (do not display dialogue box) or 1 (display dialogue box). Default value: 0
This option displays the authentication dialog box when the HTTP Get or HTTP Request command is executed. By default, this command never displays the dialog box and you must normally use the HTTP AUTHENTICATE command. However, if you want an authentication dialog box to appear so that users can enter their identifiers, then pass 1 in value. The dialog box only appears when the request requires authentication.
HTTP follow redirect Longint 2 value = 0 (do not accept redirections) or 1 (accept redirections).
Default value = 1
HTTP max redirect Longint 3 value = Maximum number of redirections accepted
Default value = 2
HTTP reset auth settings Longint 5 value = 0 (do not delete information) or 1 (delete information). Default value: 0
This option indicates to 4D to reset the authentication information of the user (user name, password, method) after each execution of the HTTP Get or HTTP Request command in the same process. By default, this information is kept and reused for each request. Pass 1 in value to delete this information after each call. Note that regardless of the setting, this information is deleted when the process is killed.
HTTP timeout Longint 1 value = timeout of client request, expressed in seconds. This timeout sets how long the HTTP client waits for the server to respond. After this period of time has passed, the client closes the session and the request is lost.
By default, this timeout is 120 seconds. It can be changed because of specific characteristics (network state, request characteristics, etc.).

You can call options in any order. If the same option is set more than once, only the value of the last call is taken into account.



See also 

HTTP AUTHENTICATE
HTTP GET OPTION

 
PROPERTIES 

Product: 4D
Theme: HTTP
Number: 1160

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v13
Modified: 4D v19 R7

 
ARTICLE USAGE

4D Language Reference ( 4D v20 R7)