Hi, Mark:
You can persist an options file on the server and refer to it by name:
http://docs.marklogic.com/guide/rest-dev/search#id_48838
That said, my understanding is that POST is only specified to prevent
caching by HTTP intermediaries. Unless there are gateways, proxies,
and so on between the client and server, I wouldn't expect that to be
a big issue.
Erik Hennum
________________________________
From: [email protected]
[[email protected]] on behalf of Mark Shanks
[[email protected]]
Sent: Monday, October 24, 2016 5:56 PM
To: [email protected]
Subject: [MarkLogic Dev General] Using extract-document-data with GET and a
REST endpoint
Hi,
I have a REST endpoint up and can query documents so that the elements returned
are limited by the following Options.xml file:
<search xmlns="http://marklogic.com/appservices/search">
<qtext>test</qtext>
<options xmlns="http://marklogic.com/appservices/search">
<extract-document-data selected="include">
<extract-path>/audit/auditor</extract-path>
<extract-path>/audit/date</extract-path>
</extract-document-data>
<return-results>false</return-results>
</options>
</search>
I call the REST endpoint using:
curl --anyauth --user admin:admin -X POST -i -H "Content-type: application/xml"
-H "Accept: multipart/mixed; boundary=BOUNDARY" -d @./Options.xml
http://localhost:8111/LATEST/search
However, am I right that this is not the best way to do it as POST requests
never get cached, whereas if I used a GET cache the requests could be cached??
However, is it possible to run the above constraint using GET rather than POST?
I tried setting a predefined search using something like the following:
curl --anyauth --user admin:admin -T "Options.xml" -H "Content-type:
application/xml" http://localhost:8111/LATEST/config/query/test
However, I just get an error. Is it possible to POST the Options.xml and then
use GET to actually retrieve the data?
Thanks.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general