[En-Nut-Discussion] MimeHandler questions

Ole Reinhardt ole.reinhardt at embedded-it.de
Mon Jun 22 10:04:23 CEST 2009


Hi!

> It seems the query is already parsed when calling the MimeHandler.
> I noticed that POST args are not handled?
> NutHttpProcessPostQuery isn't called anywhere despite the fact that
> it is compiled in and consumes code space.

You have to call it in your own code. This makes sense as sometimes you
might not want to parse the post data into name = value tuples but read
the data as is (uploading a file, sending custom data, ...).

The code will like somewhat similiar like this:

        NutHttpProcessPostQuery(stream, req);
        count = NutHttpGetParameterCount(req);


        for (idx = 0; idx < count; idx++) {
            name  = NutHttpGetParameterName(req, idx);
            value = NutHttpGetParameterValue(req, idx);

> > With cgi I send the result with the following code:
> >         NutHttpSendHeaderTop(stream, req, error, "Ok");
> >         NutHttpSendHeaderBot(stream, (char*)ctype, -1);
> >         fputs(page, stream);
> > The ASP and SSI code makes me believe that this has to be done
> > differently.
> > Is modifying the mime type possible at all?
> It seems that it isn't possible.
> I will just setup a few differend endings: .lua .xlua

The function you need is 

NutSetMimeHandler(".lua", NutHttpProcess....);

Indeed the current api is not very comfortable in every place but
designed as a very liteweight design.

Bye,

Ole Reinhardt

-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT                                                 |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list