Hi Seenivasan,
your example is running fine on my machine (no matter which value I choose for the status-only attribute).
Is there any reason why you don't directly access your RESTXQ functions? I know too less about your architecture, but, as a general guideline, it's not recommended to perform http/restxq/rest calls on the same machine (i.e., localhost), as you might run into deadlock issues. In particular, this will happen if your query will be managed by the same database context. You won't encounter any issues, however, if you have completely separated BaseX instances for your query and your web services.
Hope this helps, Christian ___________________________
Hi all,
I want to share my experience with HTTP module while posting to
restxq.
Consider this example,
import module namespace http='http://expath.org/ns/http-client'; let $req := <http:request method="GET" href="http://localhost:8984/restxq/example" status-only = "false" username = "admin" password = "admin" send-authorization="true"> </http:request>
let $resp := http:send-request($req) return $resp
run the same query with status-only="false" and status-only="true".
the first one(status-only="false") gives exception while the second one(status-only="true") returns proper response header. This is making difficult to handle the response of some requests which MAY contain body data. suppose we want to return the content of the document, if exists, as response body or a standard 410 status. The request should obviously contain status-only = "false".
we also tried handling response with the one below, but the issue does exists. rest:response <http:response status="410" reason="Gone"> </http:response> </rest:response>
I have tried with other http client like Firefox Poster plug-in and it is returning expected response. Is there anything wrong in the approach?
Thanks, Seenivasan _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk