Sorry for forgetting the greetings because of a misclick. ;-)
Dear all,
...
I've the following simplified RESTXQ code snippet that I use with basex 7.8.
declare %rest:path("/exists") %rest:HEAD %rest:form-param("message","{$message}") function page:exist( $message as xs:string) {
try{ if ($message = 'yes') then () else error(xs:QName("err:ERR"), "Message wasn't yes!")
} catch * { rest:response <http:response status="404" reason="{$err:description}"> <http:header name="DBG" value="{'message was '|| $message}"/> </http:response> </rest:response> } };
This is always returning HTTP status 404 with reason "No function found that matches the request". This happens only for the 400 status code. Any other status code I use to set behaves as expected including 404 itself. Any hints? Thank you. Regards, Marco.