Skip to content
Discussion options

You must be logged in to vote

It is a validation rule, you need to read the parameter from context:

private static String getThing(Context context) {
    // read param you defined in annotation
    var apiKey = context.header("x-api-key").value();
    System.out.println(apiKey);
    return "works!";
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@coreagile
Comment options

@jknack
Comment options

@coreagile
Comment options

Answer selected by coreagile
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment
Category
Q&A
标签
None yet
2 participants