libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] iterating over every query argument for a GET reques


From: Christian Grothoff
Subject: Re: [libmicrohttpd] iterating over every query argument for a GET request?
Date: Sun, 14 Nov 2010 23:46:07 +0100
User-agent: KMail/1.13.2 (Linux/2.6.32-25-generic; KDE/4.4.2; i686; ; )

You want to call

MHD_get_connection_values

with

MHD_GET_ARGUMENT_KIND

Best,

Christian

On Sunday, November 14, 2010 10:48:58 pm Basile Starynkevitch wrote:
> Hello,
> 
> Assuming a libmicrohttpd application is recieving a GET request for an
> URL like http://localhost:8086/foo/bar?x1=a&x2=b&y=c
> is there some way to iterate on every query argument (e.g. x1, x2, y in
> that case)?
> 
> I did look into the querystring_example.c and know about the
>   MHD_lookup_connection_value (connection,
>                                MHD_GET_ARGUMENT_KIND,
>                                argname)
> function call, but what should I do if I don't know the possible
> argname-s and want to iterate on all of them?
> 
> Is there some way to register a get argument iterator function
> which (in the same example) would be called 3 times:
>   first, with key ="x1" and value = "a"
>   second, with key = "x2" and value = "b"
>   third, with key = "y" and value = "c"
> 
> Or (less pleasant, but manageable) is there some way to get the entire URL
> string "/foo/bar?x1=a&x2=b&y=c" which I would have to parse myself?
> 
> Cheers.



reply via email to

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