apisix-go-plugin-runner icon indicating copy to clipboard operation
apisix-go-plugin-runner copied to clipboard

request help: rewrite the http request method,

Open kongh opened this issue 2 years ago • 1 comments

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 only GET/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

kongh avatar Jul 07 '22 14:07 kongh

Would you like to contribute?

soulbird avatar Jul 09 '22 15:07 soulbird