apache / apisix-go-plugin-runner

Go Plugin Runner for APISIX
https://apisix.apache.org/
Apache License 2.0
167 stars 69 forks source link

request help: How to get request body in Filter? #77

Closed liuhuihui01 closed 2 years ago

liuhuihui01 commented 2 years ago

Issue description

在写一个鉴权的自定义插件,需要获取请求参数进行加签校验,防止请求参数被篡改,但是从pkg/http/Request 中如何获取请求(POST)参数body?

Environment

shuaijinchao commented 2 years ago

You can get the request body through the r.Body() API.

shuaijinchao commented 2 years ago

API documentation can refer to: https://pkg.go.dev/github.com/apache/apisix-go-plugin-runner@master/pkg/http#Request, this function will be officially released in 0.3.0 and is currently released in progress.

liuhuihui01 commented 2 years ago

thanks