我在RestTemplate中是全新的,基本上也在REST API中.我想通过Jira REST API在我的应用程序中检索一些数据,但是要取回401 Unauthorized.找到并发表关于jira rest api文档的文章,但实际上并不知道如何将其重写为java,因为该示例使用curl命令行方式.我将不胜感激任何建议或建议如何重写:
curl -D- -X GET -H "Authorization: Basic ZnJlZDpmcmVk" -H "Content-Type: application/json" "http://kelpie9:8081/rest/api/2/issue/QA-31"
Run Code Online (Sandbox Code Playgroud)
使用spring rest模板进入java.其中ZnJlZDpmcmVk是base64编码的username:password字符串.非常感谢你.