API disabled in the context of body_filter_by_lua #14786
-
|
Hello, I would like to inquire why it is not possible to send HTTP requests using resty.http during the header_filter or body_filter phases. Currently, there is a requirement to determine whether to retry a request based on the HTTP response status, and also to modify the original body and header information. I have tried retrying in the balance try_callback method, but it does not support modifying content by calling functions like kong.service.request.set_raw_body. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
resty.http bases on ngx.tcp.socket, it only works in the phases which can yield. see https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#ngxsockettcp. |
Beta Was this translation helpful? Give feedback.
Store them in the
ngx.ctx?