HTTPc_FormMultipartFormat
Formats a Multipart 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_FormMultipartFmt (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_INVALIDHTTPc_ERR_FORM_CREATE
Returned Values
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.
- This API function can only be used to format form with simple key-value pairs field. For more complicated form, like to send a file, you will need to pass the form table to the µC/HTTP-client stack that will take care of creating the form and using hook functions to get the data. See this example for more details.