Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get the request query params #80

Open
deepakpcontus opened this issue May 26, 2023 · 1 comment
Open

get the request query params #80

deepakpcontus opened this issue May 26, 2023 · 1 comment

Comments

@deepakpcontus
Copy link

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?

@metamemelord
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants