Clarification on `HttpClient`, `HttpClientRequest`, and `HttpClientResponse` Roles
Everytime I stop using this methods for a while I have the same doubts when I come back to them. I'm a bit confused about the different roles of
My understanding is that everything under
However there is also the same method in
The clients generated by
I'm a bit confused about when to use which one and what are the parts that are compatible and the ones that are incompatible.
Is it better to filter for statusOk when creating the client? Or when handling the responses? I gues that will be different based on each situation of course, but what people tend to do more?
HttpClientRequest, HttpClientResponse and HttpClient.My understanding is that everything under
HttpClient is for creating clients or modifying their behavior, so for example HttpClient.filterStatusOk will make the client error on non 2XX responses. However there is also the same method in
HttpClientResponse, but I can't just pipe a request to that like this:The clients generated by
HttpClient.HttpClient seems to be capable of execute request directly through .post ,.get and friends, but there is also the execute where you can build HttpCLientRequests like this:I'm a bit confused about when to use which one and what are the parts that are compatible and the ones that are incompatible.
Is it better to filter for statusOk when creating the client? Or when handling the responses? I gues that will be different based on each situation of course, but what people tend to do more?
