libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] How to handle multiple data in POST?


From: Christian Grothoff
Subject: Re: [libmicrohttpd] How to handle multiple data in POST?
Date: Sun, 26 Dec 2010 14:59:00 +0100
User-agent: KMail/1.13.5 (Linux/2.6.35-23-generic; KDE/4.5.1; i686; ; )

On Thursday, December 23, 2010 10:21:08 pm Nitesh Bhatia wrote:
> Hi
> I am a newbie implementing libmicrohttpd for one of my project. I am
> following the example simplepost.c . I want to extend the same such that my
> form takes two inputs say firstname and lastname and after post it should
> display Hi <firstname> <lastname>. I am unable to understand
> the iterate_post method given in the code.
> I have following two confusions:
> 1. How to process multiple data in POST request?
> 2. In the next following page with text:
> const char *greatingpage =
> "<html><body><h1>Distance =  %s!</center></h1></body></html>";
> Where is is value of %s coming from?
> 
> Could anyone please help me how to proceed?
> 
> Thanks and Regards
> Nitesh

Simply use 'MHD_create_post_processor' and pass a function for the 
'MHD_PostDataIterator' which will then be called for each item in the post 
request. See 'src/testcurl/daemontest_post.c' for an additional full example 
for using the post processor API.

As for (2), you're seeing the

     snprintf (answerstring, MAXANSWERSIZE, greatingpage, data);
     
call, right?

Happy hacking,

Christian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]