postman中增加Authorization Bearer apiToken的方法通过代码怎么写呢?

图片说明

如上图,通过postman是可以调通的,通过springboot接口怎么增加token呢?

js和java都可以,感谢!
我希望通过restTemplate调用,代码片段

 Map resMap = restTemplate.postForObject(boostpayConfiguration.getUrl(), returnMap, Map.class);
MultiValueMap<String, Object> requestBody = new LinkedMultiValueMap<>();
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        HttpPost httpPost = new HttpPost(boostpayConfiguration.getUrl());
        String jsonString = JSON.toJSONString(returnMap);
        StringEntity entity = new StringEntity(jsonString, "UTF-8");
        httpPost.setEntity(entity);
        httpPost.setHeader("Content-Type", "application/json;charset=utf8");
        httpPost.setHeader("Authorization", "Bearer " + boostPayVO.getApiToken());
        CloseableHttpResponse response = null;
        // 由客户端执行(发送)Post请求
        response = httpClient.execute(httpPost);
        // 从响应模型中获取响应实体
        HttpEntity responseEntity = response.getEntity();
        log.info("=====响应状态为:{}", response.getStatusLine());
        if (responseEntity != null) {
            log.info("=====响应内容长度为:{}", responseEntity.getContentLength());
            String responseJson = EntityUtils.toString(responseEntity);
            log.info("=====响应内容为:{}", responseJson);
            return JSON.parseObject(responseJson, Map.class);
        }

自己动手风衣足食

可供参考:

        HttpHeaders headers = new HttpHeaders();
        // 设置token到请求头 header
        headers.add("Authorization", "Bearer 560xxxxxxxxxxxx");
        //设置请求题 body
        MultiValueMap<String, String> requestBody = new LinkedMultiValueMap<>();
        requestBody.add("params", "1");
        //HttpEntity
        HttpEntity<MultiValueMap> requestEntity = new HttpEntity<MultiValueMap>(requestBody, headers);
        RestTemplate restTemplate = new RestTemplate();
        //post
        ResponseEntity<String> responseEntity = restTemplate.postForEntity("http://xxxxxx", requestEntity, String.class);