HTTPc_FormAppFormat

Formats a Application type Form from a table before sending the HTTP POST request. Only HTTPc_KEY_VAL objects are accepted in the form.

Files

http-c.h/http-c.c

Prototype

          CPU_INT32U  HTTPc_FormAppFmt (CPU_CHAR              *p_buf,
                                        CPU_INT16U             buf_len,
                                        HTTPc_FORM_TBL_FIELD  *p_form_tbl,
                                        CPU_INT16U             form_tbl_size,
                                        HTTPc_ERR             *p_err);


Arguments

p_buf

Pointer to the application buffer where to copy the formatted form.

buf_len

Size of buffer.

p_form_tbl

Pointer to form table to format.

form_tbl_size

Size of the form table.

p_err

Pointer to variable that will receive the return error code from this function:

HTTPc_ERR_NONE
HTTPc_ERR_NULL_PTR
HTTPc_ERR_FORM_TYPE_INVALID
HTTPc_ERR_FORM_BUF_LEN_INVALID

HTTPc_ERR_FORM_CREATE

Returned Values

The size of the formatted form.

Required Configuration

The preprocessor macro configuration HTTPc_CFG_FORM_EN must be set to DEF_ENABLED.

Notes / Warnings

See the example here for a example on how to use this function correctly.