You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "zxyao145 (via GitHub)" <gi...@apache.org> on 2023/07/25 12:15:06 UTC
[GitHub] [apisix-go-plugin-runner] zxyao145 opened a new issue, #136: request help: how to rewrite request body?
zxyao145 opened a new issue, #136:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/136
### Issue description
How to rewrite request body?
### Environment
* APISIX Go Plugin Runner's version: v0.5.0
* APISIX version: 3.2.0
* Go version: 1.19.4
* OS (cmd: `uname -a`): debian
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] request help: how to rewrite request body? [apisix-go-plugin-runner]
Posted by "zxyao145 (via GitHub)" <gi...@apache.org>.
zxyao145 closed issue #136: request help: how to rewrite request body?
URL: https://github.com/apache/apisix-go-plugin-runner/issues/136
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] request help: how to rewrite request body? [apisix-go-plugin-runner]
Posted by "yanmxa (via GitHub)" <gi...@apache.org>.
yanmxa commented on issue #136:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/136#issuecomment-1792901845
I think you can do it by following two steps:
1. Add a method to the interface: [SetBody(body []byte)](https://github.com/apache/apisix-go-plugin-runner/blob/f04930485b11ec29121585b2864157c957602be8/pkg/http/http.go#L37)
2. Implement it in the [default request](https://github.com/apache/apisix-go-plugin-runner/blob/f04930485b11ec29121585b2864157c957602be8/internal/http/request.go#L41)
```golang
func (r *Request) SetBody(body []byte) {
r.body = body
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] request help: how to rewrite request body? [apisix-go-plugin-runner]
Posted by "zxyao145 (via GitHub)" <gi...@apache.org>.
zxyao145 commented on issue #136:
URL: https://github.com/apache/apisix-go-plugin-runner/issues/136#issuecomment-1793458301
Yes, and this is a new feature.
https://github.com/apache/apisix/pull/9990
In the old version, although this API existed, it did not take effect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org