romainbsl
05/12/2025, 10:00 AMonRequest
.
Maybe there is a semantic explanation for both usage, but at the end what do you suggest to use ?Aleksei Tirman [JB]
05/12/2025, 11:17 AMclient.plugin(HttpSend).intercept {}
is the same as on(Send) {}
and happens during the actual sending of the request. The onRequest
is executed during the request transformation. Can you describe the problem you're trying to solve?romainbsl
05/12/2025, 11:39 AMHttpSend
act on during the send phase, it does allow us to transform the request? so I am still confused about which approach is better).Aleksei Tirman [JB]
05/12/2025, 11:46 AMon(Send)
and onRequest
is that on(Send)
is executed on each actual sending of the request, but onRequest
is only once per client.request(...)
call. For example, if the client follows redirects and the server responds with 301 or 302, the on(Send)
will be executed for the initial request and for each redirection request made internally by the HttpRedirect
plugin. On the other hand, onRequest
will be executed only once on the initial request.romainbsl
05/12/2025, 11:49 AM