Tool/software: TI-RTOS
Hello,
I have a problem with http server. I would like to POST JSON with size larger than 1135 I always get the following response:
<html>
<body>
<h1>HTTP/1.0 400 - Bad Request</h1>
</body>
</html>
The more data I sent the later I got the above error message. I suppose there must be a limit for the POST, but I dont know where.
Here is my post handler but it never runs and the argument 'buff' is allocated in the EPI ram with enough size.
static cJSON * http_readReq(SOCKET s, int len, char * buff, size_t buffLen, int * c) {
// clear buff
memset(buff, 0, buffLen);
// its a GET req
if(!len) {*c = HTTP_CODE_OK; return NULL;}
// check buffer sizes
if(len > buffLen) {*c = HTTP_CODE_REQ_ENTRY_LARGE; return NULL;}
// try read the whole req. body
if(recv(s, buff, len, MSG_WAITALL) == len) {
cJSON * jReq = cJSON_Parse(buff);
*c = jReq ? HTTP_CODE_OK : HTTP_CODE_BAD_REQUEST;
return jReq;
}
*c = HTTP_CODE_BAD_REQUEST; return NULL;
}
I don't know how to debug the problem, becase the problem should be somewhere in the following function:
efs_createfile("myuri", 0, (uint8_t *)myFxHandler);
I have functions implemented on the board returning large payloads for GET requests, but I can not POST large data.
Any idea?
