rails : grape-swagger-rails API 在 swagger 文档中使用 http 而不是 https 请求
rails : grape-swagger-rails API request with http instead of https in swagger documentation
API 托管在 https 上。当我尝试请求 API 时,请求是发送到 http 而不是 https,这给出了错误结果。
Mixed Content: The page at .... ....was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
如何将其设置为在 https 而不是 http 上发出请求。
我发现我在base.rb中没有设置base_path
为了解决这个问题,我们需要添加
add_swagger_documentation base_path: "https://ssl.domain.com"
API 托管在 https 上。当我尝试请求 API 时,请求是发送到 http 而不是 https,这给出了错误结果。
Mixed Content: The page at .... ....was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
如何将其设置为在 https 而不是 http 上发出请求。
我发现我在base.rb中没有设置base_path 为了解决这个问题,我们需要添加
add_swagger_documentation base_path: "https://ssl.domain.com"