/* API MODULE Copyright (C) 2016-2019 by Xose PĂ©rez Copyright (C) 2020-2021 by Maxim Prokhorov */ #pragma once #include "espurna.h" #include "api_impl.h" #include "web.h" #include #if WEB_SUPPORT bool apiAuthenticateHeader(AsyncWebServerRequest*, const String& key); bool apiAuthenticateParam(AsyncWebServerRequest*, const String& key); bool apiAuthenticate(AsyncWebServerRequest*); #endif void apiCommonSetup(); bool apiEnabled(); bool apiRestFul(); String apiKey(); #if WEB_SUPPORT using ApiBasicHandler = std::function; using ApiJsonHandler = std::function; void apiRegister(const String& path, ApiBasicHandler&& get, ApiBasicHandler&& put); void apiRegister(const String& path, ApiJsonHandler&& get, ApiJsonHandler&& put); #endif void apiSetup(); bool apiError(ApiRequest&); bool apiOk(ApiRequest&);