Hi, Vikas:
In MarkLogic 6, you can set HTTP status codes in error conditions by throwing
RESTAPI-EXTNERR:
http://docs.marklogic.com/6.0/guide/rest-dev/transforms#id_50497
But, as you already know, support for setting HTTP status codes in success
conditions was added in 7.
If for some reason you can't upgrade to 7, a resource service extension could
probably eval into a separate transaction to perform the real work of the
resource service extension and then, after the eval finishes, throw a
RESTAPI-EXTNERR error to set the status code.
Hoping that helps,
Erik Hennum
________________________________
From: [email protected]
[[email protected]] on behalf of
[email protected] [[email protected]]
Sent: Wednesday, February 18, 2015 7:36 AM
To: [email protected]
Subject: Re: [MarkLogic Dev General] Response code issue in marklogic6
Hi Joe,
Thanks for your reply but setting output-status worked in Marklogic7 only not
in Marklogic6.
Regards,
Vikas Singh
________________________________
From: [email protected]
[[email protected]] on behalf of Joe Bryan
[[email protected]]
Sent: Wednesday, February 18, 2015 8:34 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Response code issue in marklogic6
Hi Vikas,
The REST API sets the HTTP status code based on the "output-status" property of
the $context map. Try this:
map:put($context, "output-status", (200, "Ok"))
Thanks.
-jb
From: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Wednesday, February 18, 2015 at 5:35 AM
To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Response code issue in marklogic6
Hi All,
I override PUT method of rest api in Marklogic6,when I am setting response
code using xdmp:set-response-code(int,”msg”) .
I am not finding set response code ,it always return 200. How can I achieve
this .
Regards,
Vikas Singh
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient(s), please reply to the sender and
destroy all copies of the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email,
and/or any action taken in reliance on the contents of this e-mail is strictly
prohibited and may be unlawful. Where permitted by applicable law, this e-mail
and other e-mail communications sent to and from Cognizant e-mail addresses may
be monitored.
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient(s), please reply to the sender and
destroy all copies of the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email,
and/or any action taken in reliance on the contents of this e-mail is strictly
prohibited and may be unlawful. Where permitted by applicable law, this e-mail
and other e-mail communications sent to and from Cognizant e-mail addresses may
be monitored.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general