[HELP] How to based on Query param to route?
- Dominant language
- Go
- Stars
- 25.6k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
A third party POST request to us is like: https://xxx.com?cmdType=ABC
Is possible to depend on 'cmdType' to register different routing?
For example:
app.Party("/entry", func(ctx iris.Context){
cmd := ctx.Params().GetString("cmdType")
if cmd == "ABC" {
// call ABC handler
}else if cmd == "EFG" {
// call EFG handler
}
})
Contributor guide
Research direction
Start with the routing and request-parameter documentation around app.Party and the ctx.Params().GetString call shown in the issue. Verify whether query-based dispatch is supported and identify the appropriate approach for routing ABC and EFG requests; done means the behavior is clearly confirmed or documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100