SolarEnergy/esp32_device/main/unsecure_api.c

22 lines
452 B
C

#include "unsecure_api.h"
#include "constants.h"
#include "http_client.h"
#include "esp_log.h"
static const char *TAG = "unsecure_api";
char *unsecure_api_get_secure_origin()
{
const char *url = BACKEND_UNSECURE_URL "/secure_origin";
http_request_opts opts = {.url = url};
char *res = http_client_exec(&opts);
if (!res)
{
ESP_LOGE(TAG, "Failed to query api secure origin!");
return NULL;
}
return res;
}