RestXQ custom HTTP error code
Friday, 10 May 2019 · 2 messages · last reply 13 May 2019
JC
Jerome Chauveau10 May 2019 10:46 #
Hi,
I am trying to return a custom http error code in my rxq webapp (jetty embeded) like is the documentation :
declare
%rest:path ( "/teapot" )
function page:teapot() {
fn: error ( xs:QName ( 'error' ), "I'm a teapot" , 418)
};
My client always receive a 400 instead of 418.
Tests are running on BaseX912 & BaseX921.
Thank you for your time.
Regards,
Jérôme Chauveau
CG
Christian Grün13 May 2019 12:20 #
Dear Jérôme,
Thanks for your observation. I have readopted the processing of the XQuery error code; it’s working again in the latest snapshot [1].
Salutations,
Christian
[1] http://files.basex.org/releases/latest/
Quoted text · Jerome Chauveau · 21 lines
On Fri, May 10, 2019 at 10:46 AM Jerome Chauveau <jerome.chauveau at unicaen.fr> wrote: > > Hi, > > I am trying to return a custom http error code in my rxq webapp (jetty embeded) like is the documentation : > > declare > %rest:path("/teapot") > function page:teapot() { > fn:error(xs:QName('error'), "I'm a teapot", 418) > }; > > My client always receive a 400 instead of 418. > > Tests are running on BaseX912 & BaseX921. > Thank you for your time. > > Regards, > > Jérôme Chauveau
Written for BaseX 9.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery