Hi Robert,

You need to encode the params into key-value pairs into the data element of the 
options, and specify url-encoded content type. That should do the trick:

xdmp:http-post("http://localhost:8888/test/show-request.xqy";, <options 
xmlns="xdmp:http"><headers>
<Content-type>application/x-www-form-urlencoded</Content-type>
</headers><data>foo=bar</data></options>)

Kind regards,
Geert

>


Drs. G.P.H. (Geert) Josten
Consultant


Daidalos BV
Hoekeindsehof 1-4
2665JZ Bleiswijk

T +31 (0)10 850 12 00
F +31 (0)10 850 1199

mailto:[email protected]
http://www.daidalos.nl/

KvK 27164984

P Please consider the environment before printing this mail.
De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Runstein, Robert E. (Contr) (IS)
> Sent: dinsdag 2 februari 2010 22:01
> To: General Mark Logic Developer Discussion
> Subject: [MarkLogic Dev General] Sending parameters with
> xdmp:http-post
>
> I have an external service that requires two named parameters
> via HTTP POST.  I have sample code from the service provider
> for sending the parameters from Java, but as my processing is
> all in XQuery, I'd prefer to use xdmp:http-post.
>
>  I see the examples for xdmp:http-post where an XML or SOAP
> document can be posted, but how do I specify the named
> parameters required by the service?  Do I need to create an
> HTML page containing a form with named input tags
> corresponding to the parameter names and pass the page within
> the options data element or is there another way?
>
> e.g.,
>
> <html>
>
> <body>
>
> <form>
>
> <input type="text" name="parameter1">
>
> <input type="text" name="parameter2">
>
> </form>
>
> </body>
>
> </html>
>
> Bob
>
>
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to