ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Пятница
3 мая
969414 Топик полностью
evgeniy1294 (09.01.2020 14:46, просмотров: 246) ответил Сидоргек на Он там (по крайней мере в той версии, которую подшивает к проекту КУБ) какой-то "односторонний". Можно настроить коллбэк в который будут передаваться пары переменная-значение из HTTP-запроса. Но отправить какой-нить JSON в ответ на этот запрос
В return подставить строку пробовали? Из справки: http://lwip.nongnu.org/2_1_x/group__httpd.html
Function pointer for a CGI script handler. This function is called each time the HTTPD server is asked for a file whose name was previously registered as a CGI function using a call to http_set_cgi_handlers. The iIndex parameter provides the index of the CGI within the cgis array passed to http_set_cgi_handlers. Parameters pcParam and pcValue provide access to the parameters provided along with the URI. iNumParams provides a count of the entries in the pcParam and pcValue arrays. Each entry in the pcParam array contains the name of a parameter with the corresponding entry in the pcValue array containing the value for that parameter. Note that pcParam may contain multiple elements with the same name if, for example, a multi-selection list control is used in the form generating the data. The function should return a pointer to a character string which is the path and filename of the response that is to be sent to the connected browser, for example "/thanks.htm" or "/response/error.ssi". The maximum number of parameters that will be passed to this function via iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in the incoming HTTP request above this number will be discarded. Requests intended for use by this CGI mechanism must be sent using the GET method (which encodes all parameters within the URI rather than in a block later in the request). Attempts to use the POST method will result in the request being ignored.