Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个中间件程序,它在内部调用第三方 api。第三方 api 以 301 响应,包括一些标头。我已经响应我到前端的响应。是否有任何代码示例可以做到这一点?
在这种情况下,我没有看到其他选项,而是构建设置标题的响应对象。
public Result proxy() { response().setHeader(myHeader, headerValue1); // all your custom headers return status(Http.Status.MOVED_PERMANENTLY, "response body").as(your media type); }