Configuration Options


Set the system configuration options in the file src/config/config_ip_app_httpc.h. This section lists the options and their default values.

HTTPC_CONN_TASK_STACK_SIZE

The HTTP connection task stack size. The default value is 2048. All request (open, write, and close) and response (open, read, and close) functions are called from this task, so set the stack size accordingly.

HTTPC_SRV_PORT

The default server port. The default value is 80.

HTTPC_MAX_CONNECTIONS

The maximum number of connections. The default value is 4.

HTTPC_MAX_TRANSFER_UNIT

The maximum transfer size a connection can send at a time. The default value is 2048. Depending on the size of the assigned buffers, this can be slightly increased.

HTTPC_RESPONSE_TIMEOUT

The idle timeout. This is the time in seconds after which the connection is closed if there is no communication on it. The default value is 10.

Note:  For this timeout the precision is 500ms, so timeout may occur 500ms earlier.

HTTPC_MAX_REQUEST_URI_BUF_SIZE

The maximum file request buffer size. The default value is 128. The request buffer holds the request URI, the optional URL-encoded INPUT string.

HTTPC_MAX_REQUEST_HOST_SIZE

The maximum request host buffer size. The default value is 64. The request buffer holds the host header value.

Note:  The following two options define the default parameters written to the request header.

HTTPC_HEADER_VER

The default header HTML version. The default value is "HTTP/1.1".  

HTTPC_HEADER_USER_AGENT

The default user agent name. The default value is "HCC demo".

HTTPC_USE_SOCKET

Keep the default of 0 to use the native HCC implementation. Set it to 1 to use the BSD socket implementation.

Note:  The following two options configure HTTP Secure connections.

HTTPC_SECURE_ENABLE

Keep the default of 1 to enable HTTP Secure connections, otherwise set it to 0. This option must be enabled for dynamic variables. 

HTTPC_SEC_TRANSFER_UNIT

The HTTP secure connection transfer unit for socket connection. The default value is 1200.

This must be less than the maximum data that can be transferred by TLS in a single secure PDU.