【发布时间】:2019-08-22 21:53:36
【问题描述】:
我有一个代码,我在其中发布请求,响应代码是 201,使用“Location”创建:新创建资源的“URL”标头。
final Response response = await _http.post(getUri(_url), body: plan);
return _getPlan(response.headers['location']);
其中_http 是来自包http-0.12.0+1 的BrowserClient。但是response.headers['Location'] 是空的。 headers 数组本身只包含一个元素 Content-Type。
在 Chrome 开发人员工具中,我看到所有响应标头,包括 Location。
我究竟做错了什么?如何访问响应标头?
【问题讨论】: