pub unsafe extern "C" fn httpd_req_get_cookie_val(
    req: *mut httpd_req_t,
    cookie_name: *const c_char,
    val: *mut c_char,
    val_size: *mut usize
) -> esp_err_t
Expand description

@brief Get the value string of a cookie value from the “Cookie” request headers by cookie name.

@param[in] req Pointer to the HTTP request @param[in] cookie_name The cookie name to be searched in the request @param[out] val Pointer to the buffer into which the value of cookie will be copied if the cookie is found @param[inout] val_size Pointer to size of the user buffer “val”. This variable will contain cookie length if ESP_OK is returned and required buffer length incase ESP_ERR_HTTPD_RESULT_TRUNC is returned.

@return

  • ESP_OK : Key is found in the cookie string and copied to buffer
  • ESP_ERR_NOT_FOUND : Key not found
  • ESP_ERR_INVALID_ARG : Null arguments
  • ESP_ERR_HTTPD_RESULT_TRUNC : Value string truncated
  • ESP_ERR_NO_MEM : Memory allocation failure