请求标头值在Chrome中转换为大写

问题描述

我正在尝试将一个http帖子从一个简单的网页发布到SharePoint服务器。 该请求已在Internet Explorer上运行,但在Chrome上失败。

$.ajax({
    url:"http://redacted/_vti_bin/cellstorage.svc/CellStorageService",type:'POST',headers:{
     'MIME-Version': "1.0",'SOAPAction': "http://schemas.microsoft.com/sharepoint/soap/ICellStorages/ExecuteCellStorageRequest",'Content-Type': "multipart/related; type=\"application/xop+xml\"; boundary=\"urn:uuid:8cfcbb22-dd52-4889-b29d-9ff2dcf909b2\"; start=\"<[email protected]>\"; start-Info=\"text/xml; charset=utf-8\"",'X-Vermeer-Content-Type': "application/x-www-form-urlencoded"
    },

我的测试表明,除非请求标头大小写保持不变,否则我正在联系的Web服务(/_vti_bin/cellstorage.svc/CellStorageService)将失败:

Content-Type:多部分/相关; type =“ application / xop + xml”; boundary =“ urn:uuid:8cfcbb22-dd52-4889-b29d-9ff2dcf909b2”; start =“ [email protected]”; start-Info =“ text / xml; charset = utf-8

但是,Chrome似乎自动将请求标头值从“ utf-8”转换为“ UTF-8”,可以通过提琴手的输出进行确认。这会导致错误:

POST http://redacted/_vti_bin/cellstorage.svc/CellStorageService 400 (错误请求)

enter image description here

Content-Type:多部分/相关; type =“ application / xop + xml”; boundary =“ urn:uuid:8cfcbb22-dd52-4889-b29d-9ff2dcf909b2”; start =“ [email protected]”; start-Info =“ text / xml; charset = UTF-8

由于我不能真正更改服务器服务,所以我想知道是否有一种方法可以强制Chrome使用小写标头值而不是转换它们。

类似的帖子:

Why does Header Content-Type for POST request differ between chrome and firefox only in by "UTF-8" vs "utf-8"?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)