hello friends
I am trying esp_http_client example
I want to post some Data.
Here is the Code..........
************************************************************************************************************************************************
esp_http_client_config_t config = {
.url="http://someurl.com?id=var",
.event_handler = _http_event_handler,
.timeout_ms = 5000,
};
esp_http_client_handle_t client = esp_http_client_init(&config);
esp_err_t err;
const char *post_data = "i am running test data and example";
esp_http_client_set_method(client, HTTP_METHOD_POST);
esp_http_client_set_post_field(client, post_data, strlen(post_data));
while (1) {
err = esp_http_client_perform(client);
if (err != ESP_ERR_HTTP_EAGAIN) {
break;
}
}
************************************************************************************************************************************************
How do I set the form Variable so that I can receive the data like $data = $_POST['data'] in php file
Thanks
Arun
esp_http_client
Re: esp_http_client
Hi,
post_data is just a string like in postman or any POST request:
post_data is just a string like in postman or any POST request:
Code: Select all
data=value&data=value2
Who is online
Users browsing this forum: No registered users and 86 guests