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
This requires buffered proxying mode to be on, which in Golang means using the Response phase. Can you elaborate on which phase you used? See the following example:
package main
import (
"github.com/Kong/go-pdk"
"github.com/Kong/go-pdk/server"
"log"
)
func main() {
server.StartServer(New, Version, Priority)
}
var Version = "0.2"
var Priority = 1
type Config struct {
Message string
}
func New() interface{} {
return &Config{}
}
func (conf *Config) Response(kong *pdk.PDK) {
body, err := kong.ServiceResponse.GetRawBody()
kong.Log.Err(string(body))
log.Println(err)
}
This will give you the body.
Alternatively, if you want to use a subsequent phase, you can have an empty Response handler to ensure buffered proxying is enabled.
kong.ServiceResponse.GetHeaders(1000) returns no headers
This is a known limitation of the Lua PDK and one we are working on improving; check out Kong/kong#13827 for details. Let's please discuss this particular issue in #222.
fmt.Println(kong.ServiceResponse.GetRawBody())
I try to call this function but return empty string
how fix this please?
The text was updated successfully, but these errors were encountered: