Skip to content

Instantly share code, notes, and snippets.

@sumanentc
Created October 4, 2019 06:37
Show Gist options
  • Save sumanentc/5ef48c4d8d3905c9cfde87ef3a5109fa to your computer and use it in GitHub Desktop.
Save sumanentc/5ef48c4d8d3905c9cfde87ef3a5109fa to your computer and use it in GitHub Desktop.
//GET API which return the name of the cats specified in QueryParam
//http://localhost:8000/cats?name=arnold&type=fluffy
func GetCats(c echo.Context) error {
catName := c.QueryParam("name")
catType := c.QueryParam("type")
return c.String(http.StatusOK, fmt.Sprintf("your cat name is : %s\nand cat type is : %s\n", catName, catType))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment