Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a non-async way to get data back from a non-HTTP 200 request call in ::rest ?

33 views
Skip to first unread message

Matthew Hiles

unread,
Jan 30, 2018, 4:01:07 PM1/30/18
to
https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/rest/rest.html

I've read this page forwards and backwards but I'm hoping I'm just missing something. When I make an RESTful API call and the service sends back a HTTP 400 response, I don't get back the error data. It seems like the only way to get the error data is to make the call asynchronous and specify a callback.


Documentation for the making RESTful APIs says you should use HTTP return codes to specify error conditions. I.E. request could not be completed, return error code 400.

Given this is how you're supposed to develop RESTful APIs, it seems odd there's no way to get databack after a non-HTTP 200 response.

Matthew Hiles

unread,
Jan 30, 2018, 4:11:32 PM1/30/18
to
Well, commenting out the single line of code in rest.tcl that returns upon an HTTP error lets me get the data back, but this is not an ideal solution--I'd like to not lose the information that an HTTP error was encountered. Guess I need to think about it and supply a patch.
0 new messages