req.get('content-type') 正常的 batch 操作,response 的 正确的 batch response, success handler 即下图的 content-type 不同的 response,对应有不同的 handler 来处理。 httpClient.request 如果执行出错,会进入到 invalid MIME part type 使用分号将 每种类型都有对应的 handler,由对应的 解析 batch 操作的响应: 在出错情况下,从 Chrome 开发者工具 network 标签页里下载 batch 响应到本地,和不出错的场景比较,格式上没有任何差异: 问题出在 batch response 的 header 里的 chrome 里看到的 content-type 不是这个啊: body 是 null,所以进不去
如果我们通过 batch 请求向服务器发送一个 word 文档,则 HTTP body payload 的例子如下: Content-type: multipart/mixed; boundary="Boundary_any ascii character except some of the following special characters: ( )< > @ , ; : \ / [ ] ? = " " --Boundary_any ASCII character, except some special characters below: content-Type: text/plain;---- charset=iso-8859-1 Content-transfer-encoding: 7BIT --Boundary_ASCII characters 在 |
|