I'm using ktor's http client (tried jetty and cio)...
# ktor
t
I'm using ktor's http client (tried jetty and cio) for some tests against an api which expects a jwt in the request. when the request doesn't have a jwt the server returns 401/Unauthorized. I'm confused about the decision decision as to why the client throws if the server responds with 401/unauthorised. Am i wrong in thinking that seems to be an extreme response to a valid http response?
r
Hi, By default client throws exceptions on non 2xx requests. You may disable it by setting
expectSuccess
to
false
in client or per-request config
t
brilliant thank you 🙏