【问题标题】:jhipster rest api: curl example shown by swagger-ui not workingjhipster rest api:swagger-ui 显示的 curl 示例不起作用
【发布时间】:2016-08-22 22:50:03
【问题描述】:

尝试使用 curl 示例调用生成的 REST-API 时卡住了,如 swagger-ui 所示。

curl -X GET --header 'Accept: application/json' --header 'X-CSRF-TOKEN: 69b86f52-c3a4-4c06-ae9f-baebee0a01f2' 'http://localhost:8080/api/users'

谁能帮帮我。我错过了什么吗?是否需要一些调用才能首先获取会话 cookie?

亲切的问候, 德克·丁格

【问题讨论】:

    标签: curl jhipster swagger-ui


    【解决方案1】:

    可能是 SimpleCorsFilter 错误。这是真的?

    【讨论】:

      【解决方案2】:

      如果您在 JHipster 中使用会话身份验证类型,那么是的,您必须首先使用 curl 在 /api/authentication 上使用登录名/密码进行身份验证,以获得映射到经过身份验证的会话的 jsessionid cookie。当您在浏览器中使用 swagger-ui 时,这已经完成了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-10
        • 2012-11-04
        • 2016-05-26
        • 2023-03-06
        • 1970-01-01
        • 2013-12-20
        • 2016-05-24
        相关资源
        最近更新 更多