[En-Nut-Discussion] using "post" method for form submit

Vesa Jääskeläinen chaac at nic.fi
Sat Feb 19 18:57:03 CET 2005


Donatas Malinauskas wrote:
> Hi all,
> 
> I am trying to use post method for data submition, but I cant get submited
> data with NutHttpGetParameterCount, NutHttpGetParameterName or
> NutHttpGetParameterValue. With method "get" everythings work fine. But I
> cant use it becouse of large amount of data any more... Have I missed
> something?

I have modified ethernut locally here, but this should get you an idea:

You could modify a bit pro/httpd.c around line 652:
---
         } else if (strncasecmp(line, "Content-Length:", 15) == 0)
             req->req_length = 0 /*atoi(&line[15]) */ ;
---

Uncomment that atoi and then something like this...

if (req->req_method == METHOD_POST)
{
   for (pos = 0; pos < req->req_length; pos++)
   {
     ch = fgetc(stream);
     if (ch == EOF) break;
     // do something with ch...
   }
}

Thanks,
Vesa Jääskeläinen



More information about the En-Nut-Discussion mailing list