kataras / kataras/iris

[HELP] How to based on Query param to route?

Open
#1,840 2 comments 0 reactions 0 assignees View on GitHub
🤔 type:question
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.