Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/53.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails:swagger文档中使用http而不是https的grape swagger rails API请求_Ruby On Rails_Swagger_Grape Api - Fatal编程技术网

Ruby on rails rails:swagger文档中使用http而不是https的grape swagger rails API请求

Ruby on rails rails:swagger文档中使用http而不是https的grape swagger rails API请求,ruby-on-rails,swagger,grape-api,Ruby On Rails,Swagger,Grape Api,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_路径 为了解决这个问题,我们需要添加 add_swagger_document

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_路径 为了解决这个问题,我们需要添加

add_swagger_documentation base_path: "https://ssl.domain.com"

我发现我没有在base.rb中设置base_路径 为了解决这个问题,我们需要添加

add_swagger_documentation base_path: "https://ssl.domain.com"