Hi Marco,
Thanks. I knew that page but the function does not work. The variable is not passed, whether I write exactly what you write or I specify "text=my text is long" ("text" is the name of the variable in the restxq function).
Thanks, J.
Il giorno 15/nov/2015, alle ore 10:19, Marco Lettere marco.lettere@dedalus.eu ha scritto:
Hi, look at [1]. This is the documentation of the http client available in BaseX following eXpath specification in [2]. Your request in particularly should look like:
http:send-request(<http:request method="POST"/>, "http://address", "my text is long")
or more declaratively:
http:send-request( <http:request method="POST" href="http://address%22%3E <http:body media-type="text/plain">My text is long</http:body> </http:request> )
BR, Marco.
[1] http://docs.basex.org/wiki/HTTP_Module#http:send-request [2] http://expath.org/spec/http-client ________________________________________ From: basex-talk-bounces@mailman.uni-konstanz.de basex-talk-bounces@mailman.uni-konstanz.de on behalf of meumapple meumapple@gmail.com Sent: Saturday, November 14, 2015 10:51 PM To: BaseX Subject: [basex-talk] Restxq
Hi All,
I am using restxq. I wrote a function which takes one variable (this should be a chunk of text, not a single word). The output is xml.
I can have the function work if I pass the content of the variable with
curl -X POST --data "variable=my text is long" http://address
How can I get the same result of the curl command with an xquery function?
More in general, is this a good way to write a function in restxq when the variable is not a single word but the content of a file? (I am not even sure if a file can be passed as such in restxq)
Thanks, Joseph