[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Accepting application/xml payload
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Accepting application/xml payload |
Date: |
Sat, 15 Jun 2013 13:55:14 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
Dear Ken,
I'm not sure I understand what your problem is; if you just get an XML stream
uploaded
to the server that you then parse yourself, why do you invoke the MHD post
processor?
You should be able to just take the upload data from the "upload_data" and
"upload_data_size"
arguments and give that _directly_ to your XML parser, replacing the calls that
you currently
make to the post processor with calls to the XML input routine.
If you don't know what the client will send you, you might of course want to
manually check
for the FORM_URLENCODING first, but again I suspect you know how to do this.
Please let me know if this doesn't solve your problem, as I might totally not
be understanding
the question.
Happy hacking!
Christian
On 06/13/2013 09:33 PM, Ken Zangelin wrote:
> Hi,
>
> I'm using microhttpd for a project developed by Telefonica R&D, Barcelona,
> Spain.
> Our "thirdparty" clients needed to send their payload as "application/xml"
> mime-type and that gave us some problems I currently cannot recall. I think
> the payload data simply didn't get through to the callbacks.
>
> The problem had a really really easy fix. I just changed the define
> MHD_HTTP_POST_ENCODING_FORM_URLENCODED from
> "application/x-www-form-urlencoded" to "application/xml", and my problem was
> solved. Actually, finally I left that definition untouched and I
> changed the use of it in postprocessor.c, to accept "application/xml" too
> when accepting "application/x-www-form-urlencoded"
> (MHD_HTTP_POST_ENCODING_FORM_URLENCODED). Just a single-line change ...
>
> Now, I do understand this is most probably not the right way to solve the
> problem but I don't really know which way IS the correct one ...
>
> I believe it might be interesting to a lot of people to be able to accept
> "application/xml".
> The parsing of the XML payload I do myself, of course ...
>
> Regards,
>
> Ken Zangelin
>
>
> ________________________________
>
> Este mensaje se dirige exclusivamente a su destinatario. Puede consultar
> nuestra política de envío y recepción de correo electrónico en el enlace
> situado más abajo.
> This message is intended exclusively for its addressee. We only send and
> receive email on the basis of the terms set out at:
> http://www.tid.es/ES/PAGINAS/disclaimer.aspx
>