简体   繁体   English

如何在rest控制器spring boot中为邮递员生成api-key

[英]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.

相关问题 如何为 Spring 从源启动微服务生成 rest 客户端 api? - How to generate rest client api for Spring Boot microservice from source? 如何使用 REST API - Spring 引导插入带有伪造密钥的数据 - How to insert data with forgein key using REST API - Spring boot Spring-boot rest api当前请求不是邮递员的多部分请求 - Spring-boot rest api current request is not multipart request with postman 如何在邮递员中将多个字符串包装成单个字符串以调用spring boot rest API Get请求 - How to wrap multiple strings into single string in postman to call spring boot rest API Get request 如何解决通过 Z03D476861AFD3854510 测试 spring 引导 rest api 时遇到的错误? - How can I solve the error I get while testing the spring boot rest api via postman? 如何使用邮递员将用户登录详细信息传递给Spring Boot Rest API - How to pass user login details to Spring Boot Rest API using postman 无法通过 spring-boot-starter-test 测试 Spring Boot REST API,而相同的“api”正在为 Postman 工作 - Unable to test Spring Boot REST API by spring-boot-starter-test while same "api" is working for Postman 如何在 Spring 引导中制作同步 rest controller? - How to make a synchronous rest controller in Spring boot? 如何使用 Spring Boot Rest Controller 返回 JSONArray? - How to return a JSONArray with a Spring Boot Rest Controller? 如何将参数传递给 Spring 引导 REST Controller? - How to pass an argument to a Spring Boot REST Controller?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM