Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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

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

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.
  • No labels