工具/软件:Code Composer Studio
您好!
我正在使用"SimpleLinkNetAppRequestEventHandler"处理程序从 HTML 页面获取和发布数据。
对于 POST 请求,我将根据从 HTML 页发送的值获得正确的值,但当我在 HTML onload()上收到请求时,我没有获得该值。
对于 POST、我使用 的是"SimpleLinkNetAppRequestEventHandler"处理程序内的 sl_NetApp_Request_HTTP_POST。
对于 Get、我在 "SimpleLinkNetAppRequestEventHandler"处理程序中使用 SL_NetApp_Request_HTTP_Get。
1.申请后:
案例 SL_NetApp_Request_HTTP_POST:
UART_PRINT ("接收到的数据是:%s\n\r\n、pNetAppRequest->requestData.pPayload);
中断;
我正在获取有关有效载荷的数据。
2.获取请求:(仅用于发送“测试”字符串)
案例 SL_NetApp_Request_HTTP_POST:
unsigned char *ptr;
pNetAppResponse->Status = SL_NetApp_HTTP_RESPONSE_200_OK;
ptr = pNetAppResponse->ResponseData.pPayload;
pNetAppResponse->ResponseData.PayloadLen = 0;
memcpy (ptr、"test"、strlen ("test"));
ptr += strlen ("test");
pNetAppResponse->ResponseData.PayloadLen += strlen ("test");
* ptr ='\0';
请建议如何在"SimpleLinkNetAppRequestEventHandler"处理程序中实现 Get 响应。
谢谢、此致、
Jasmin