You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
std.http's one-line client calls lose the status: a 404 and a 500 both read "http error" #3147
http.get, get_with_timeout, post, put and delete turn any response that is not a 2xx into the error "http error" (and anything below 200 into "unexpected status"). The status is lost: a 404, a 500 and a 503 read the same, so a caller cannot tell "not found" from "the server is down" without moving to std.http.client. std/http/module.ae, get and its siblings.
Fix: the error names the status and its reason phrase, "HTTP 404 Not Found" ("HTTP 503 Service Unavailable"), for every one-line wrapper; the reference says so; tests check a 404 and a 500 from a local server. std.http.client stays the API that hands back the whole response.
Found on #3101's successor batch (#3105, writing the HTTP example).
Activity
fix: http.get and the one-line calls name a failed status (#3147)
docs: the stdlib index counts the exports #3147, #3148 and #3149 added