apisix-go-plugin-runner
apisix-go-plugin-runner copied to clipboard
request help: rewrite the http request method,
Issue description
Environment
- APISIX Go Plugin Runner's version: v0.3.0
- APISIX version: 2.14.1
- Go version: go1.17.9 darwin/arm64
- OS (cmd:
uname -a
): Darwin x-Pro-2.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64
Question:
I need rewrite the http request method, can you add the method r.SetMethod()
just like r.SetPath()
.
Why:
- We have many apis using the
PUT
DELETE
methods, and the client do not supported those methods, but onlyGET
/POST
methods. - We consider that put extra header named
X-HTTP-Method-Override
, then , rewrite the method to this in go runner plugin.
Example: Client -> Method(POST) and X-HTTP-Method-Override: PUT -> Go Runner Plugin -> Method(PUT) -> Upstream
Would you like to contribute?