You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to rewrite the http request method.
I think about two ways, but both failed.
Way 1.
Add a method like "(r *Request) SetPath". As a result , I add a method to Request and call hrc.Req. MutateMethod.
It only changes the object of Request.r and does not change the buffer object(generated by flatbuffer which is a rpc solution of google). The program just use the content of buffer object to call the upstream api.
Way 2.
Based on way1 , there is no function at HTTPReqCall.Rewrite to change the method. I try to use functions of HTTPReqCall.Req to rebuild the buffer. It does't work and lua problems occurred !
Why:
We have some apis using the Get methods, and the client only use POST methods that can't be changed.
Client -> Method(POST) -> configuration in plugins -> Go Runner Plugin -> Method(GET) -> Upstream
screenshots:
Environment
APISIX Go Plugin Runner's version: v0.5.0
APISIX version: v3.6.0
Go version: 1.19.5
OS (cmd: uname -a): Linux localhost.localdomain 3.10.0-862.el7.x86_64 ci: enable #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
SherrillJoyceGit
changed the title
request help:
request help: Need to rewrite the http request method
Nov 6, 2023
Issue description
I need to rewrite the http request method.
I think about two ways, but both failed.
Way 1.
Add a method like "(r *Request) SetPath". As a result , I add a method to Request and call hrc.Req. MutateMethod.
It only changes the object of Request.r and does not change the buffer object(generated by flatbuffer which is a rpc solution of google). The program just use the content of buffer object to call the upstream api.
Way 2.
Based on way1 , there is no function at HTTPReqCall.Rewrite to change the method. I try to use functions of HTTPReqCall.Req to rebuild the buffer. It does't work and lua problems occurred !
Why:
We have some apis using the Get methods, and the client only use POST methods that can't be changed.
Client -> Method(POST) -> configuration in plugins -> Go Runner Plugin -> Method(GET) -> Upstream
screenshots:
![image](https://private-user-images.githubusercontent.com/43162021/280621657-749c9bf5-5a4c-4ebe-9da1-8c315c548977.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NTgyOTIsIm5iZiI6MTczODk1Nzk5MiwicGF0aCI6Ii80MzE2MjAyMS8yODA2MjE2NTctNzQ5YzliZjUtNWE0Yy00ZWJlLTlkYTEtOGMzMTVjNTQ4OTc3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDE5NTMxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQwY2Y5OTU2OTU0OWRlOTc4YWQxZDk0ZTc3YmQ2ZGY5NTllNjYyOWIzYjkxZTgxMGNiNzQwZmU0YzI0YTJhZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._j6IbiYA3-yx7cc-K-o33IG4ecr2HX9iZ_S1PKjtD4E)
Environment
uname -a
): Linux localhost.localdomain 3.10.0-862.el7.x86_64 ci: enable #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/LinuxThe text was updated successfully, but these errors were encountered: