[Top][All Lists]

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

Re: [libmicrohttpd] Accessing raw POST payload

From: Christian Grothoff
Subject: Re: [libmicrohttpd] Accessing raw POST payload
Date: Mon, 13 Oct 2014 15:15:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0

Dear Matej,

POST data is supplied incrementally via the 'upload_data' and needs to
be passed to an MHD_PostProcessor.  This is because the POST data
generally may not fit into main memory.

See src/examples/post_example.c for an example on how to handle POST data.

Happy hacking!


On 10/13/2014 02:02 PM, Matej Svejda wrote:
> Hello,
> I know some people have asked similar questions but I havent managed to
> find one that would resolve my problem: Im trying to use libmicrohttpd
> as a server that receives a JSON request via POST and responds to it.
> However I cant find a way to access the raw data that I send with my
> request.
> MHD_lookup_connection_value(connection, MHD_HEADER_KIND,
> "Content-Length") returns the right value but upload_data_size is 0 and
> when calling MHD_get_connection_values(connection, MHD_POSTDATA_KIND,
> print_con_value, NULL) print_con_value does not get called.
> Any ideas on what I might be missing would be much appreciated.
> Regards,
> Matej

Attachment: 0x48426C7E.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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