【发布时间】:2015-05-06 20:22:33
【问题描述】:
在 somefile.html 中,我使用了一个 JS,其中包含 XMLHttpRequest:
request.open('GET', 'static/name.json', true); 当我从这个地方调用 render_template('somefile.html') 时效果很好
@app.route('/') (由于请求在这里打开文件:http://localhost:5000/static/name.json
但是当我需要像这样从其他地方调用 render_template('somefile.html') 时:
@app.route('/conference//modifysession/', methods=['GET','POST']) 这是 Chrome 开发人员中显示的错误:
http://localhost:5000/conference/16/modifysession/static/name.json 404(未找到) 所以请求会自动将标头添加到我不想要的文件的 URL 中。
如何从 URL 中删除自动添加的部分?
【问题讨论】:
标签: url