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

add query string param and path param into header and context #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caevv
Copy link

@caevv caevv commented Mar 31, 2022

Description of changes:

Add API gateway path parameters and query string parameters into the header and context.

More important on this PR is the Path Parameter as this cannot be extracted any other way, happy to remove the query string parameter.

@sapessi
Copy link
Collaborator

sapessi commented Apr 21, 2022

What's the use-case for getting path parameters this way and not through the framework itself? For example in gin you'd write:

router.GET("/user/:name/*action", func(c *gin.Context) {
        name := c.Param("name")
        action := c.Param("action")
        message := name + " is " + action
        c.String(http.StatusOK, message)
    })```
    

@drakejin
Copy link
Contributor

@sapessi Do you think It's not aws-lambda-go-api-proxy's responsibility to directly manipulate path and query parameters?

Therefore, You recommend using well-known HTTP frameworks for manipulating path or query parameters. isn't it?

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

Successfully merging this pull request may close these issues.

None yet

3 participants