我试图从远程url获取特定文档的招摇过市UI,但它无法获取
可能的跨原产地(CORS)问题
from flask import Flask
from flask_swagger_ui import get_swaggerui_blueprint
app = Flask(__name__)
SWAGGER_URL = '/swagger'
API_URL = 'https://api_url/documentaion'
SWAGGERUI_BLUEPRINT = get_swaggerui_blueprint(
SWAGGER_URL,
API_URL,
config={
'app_name': "Test"
},
)
app.register_blueprint(SWAGGERUI_BLUEPRINT, url_prefix=SWAGGER_URL)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.debug = True
app.run()
无法获取,因为远程url需要身份验证标头令牌。我想在API_URL的请求中添加一些头标记,有办法吗
目前没有回答
相关问题 更多 >
编程相关推荐