Hi, Srinivas:

FWIW, I've always used the curl -d @file.xml option instead of the -T option.

However, when I tried -T locally, the only issue I ran into was with the POST.  
You
should use PUT if you are replacing the entire query options.

I notice you're using the -i option -- does the header output tell you anything?


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of Yeditha, Srinivas 
[[email protected]]
Sent: Wednesday, May 13, 2015 3:23 PM
To: [email protected]
Subject: [MarkLogic Dev General] Custom query option problem

Hi all,

We are trying to adjust the search options used by the REST API to add 
<transform-results apply="raw"/>. I have the below in opt.txt:

<options xmlns="http://marklogic.com/appservices/search";>
<transform-results apply="raw"/>
</options>


The below Curl command comes up with authentication error, although the admin 
user/password is correct. We can access admin console or qconsole or even make 
REST API calls using the same admin account.
curl --anyauth --user admin:password -X POST -T "opt.txt" -i  -H 
"Content-type:application/xml" http://mymldb:9006/v1/config/query/myopt
Myopt is the custom option name.
The above curl seems to be correct as it worked on another test database. The 
error is pasted below. Is there a way we can figure out why authentication is 
failing? It feels like we are locked out, but it doesn’t make sense. Could 
anyone please help?
<rapi:error 
xmlns:rapi="http://marklogic.com/rest-api";><rapi:status-code>401</rapi:status-code><rapi:status>Failed
 
Auth</rapi:status><rapi:message-code/><rapi:message>Unauthenticated</rapi:message></rapi:error>


Thanks,
Srinivas Yeditha

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to