【发布时间】:2021-01-04 08:31:36
【问题描述】:
我已尝试将我的 XML 作为请求发送。它看起来像这样:
let requestBody = function (method){
return "<x:Envelope"
+"xmlns:x='someurl'"
+"xmlns:inf='someurl'>"
+"<x:Header/>"
+"<x:Body>"
+"<inf:"+method+"></inf:"+method+">"
+"</x:Body>"
+"</x:Envelope>" }
"\n<x:Envelope"+
Cypress.Commands.add("getReports", (soapAction) => {
var parseXML
var action=requestBody(soapAction)
cy.fixture('urlFixture').then((url)=>{
cy.request({
method: 'POST',
url: url.indoDistV1,
headers: {
soapAction:url.actionStartAdress+soapAction,
"ContentType":"text/xml; charset=utf-8"
},
body: requestBody(soapAction)
})
})
})
响应是 415 有人知道出了什么问题吗?
谢谢
【问题讨论】:
标签: javascript api soap cypress