[英]how to generate api-key for postman in rest controller spring boot
I have this spring boot
build.我有这个
spring boot
版本。 I want to consume rest controller
@GetMapping
API.我想使用
rest controller
@GetMapping
API。
I know the credentials.我知道凭据。 I can open its dashboard using login page.
我可以使用登录页面打开它的仪表板。
But I am not able to consume Rest apis
from postman due authorization setting.但是由于授权设置,我无法使用邮递员的
Rest apis
。
Below is the REST api
that I want to consume in postman client
下面是我想在
postman client
使用的REST api
@GetMapping("/students")
@ApiOperation(value = "", authorizations = {@Authorization(value = "apiKey")})
public Response getAllStudents() {
return Response
.ok()
.setPayload(studentService.getStudents());
}
As I mentioned I know the username/password.正如我提到的,我知道用户名/密码。 How can I generate this
apiKey
field and configure in my postman
window.如何生成此
apiKey
字段并在我的postman
窗口中进行配置。
In postman go to Authorization > API key.在邮递员中,转到授权 > API 密钥。 enter your credentials and it should work
输入您的凭据,它应该可以工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.