Re: HTTP error codes Amirouche Boubekki 02 Aug 2020 13:27 UTC
Hello Lassi! Le dim. 2 août 2020 à 08:21, Lassi Kortela <firstname.lastname@example.org> a écrit : > > > Your draft makes me think that "HTTP request and response objects" > > should be its own SRFI. > > For HTTP errors we could use SRFI 198: Foreign Interface Error Handling. > > (make-foreign-error > 'set 'http > 'number 418 > 'message "I'm a teapot" > 'http-response #<http-request-object>) > > (foreign-error-ref e 'http-resonse) => #<http-request-object> > > Is there a standard set of mnemonics for the HTTP status codes? Go uses > these ones: <https://golang.org/pkg/net/http/#pkg-constants>. Each name > just seems like a CamelCase version of the title of that status. There are, so called, reasons, but I never remember those, I mostly always search the HTTP code to remember what it means. > Here's the list of HTTP status codes from IANA: > <https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml>. > I assume it's the official list, but like many IANA lists, it is > incomplete in practice. HTTP codes are not necessarily error codes. Not sure whether it is a "foreign error" either. There is prolly something to do along the lines of foreign error, I am not certain of what as of yet.