有一个post restful api with post body是纯文本,当我使用下面的代码生成一个消费者pact文件时,它显示JSON ParserError,似乎pact-js只支持json体,即使我设置了内容 - 在标题中键入text / plain
provider.setup()
.then(() => {
provider.addInteraction({
state: 'I want to add a tag',
uponReceiving: 'Step - 1 : add a tag',
withRequest: {
method: 'POST',
path: "/api/v1/tags",
headers: {
"Content-Type": "text/plain;charset=UTF-8"
},
query: {
"org": "testOrg"
}
body: "Tag_Pact_test_0001"
},
willRespondWith: {
status: 200,
body: {
"result": 0
}
}
})
})
有没有办法用post方法发送text / plain body?