fdk-go
fdk-go copied to clipboard
get the request query params
I am trying to get the request URL and parameters. But I am unable to get it. What is the method I can use to get the request params?
Have you checked the HTTPContext interface? https://github.com/fnproject/fdk-go/blob/master/fdk.go#L131
The fdk package has the exported function GetContext
that gets fdk.Context
from context.Context
passed in your function. Once you have the fdk.Context
you can perform a type assertion to fdk.HTTPContext
and access URL using the interface's methods. Note that your type assertion will succeed for HTTP calls, i.e., running fn server locally and calling function by API or using OCI API GW.