我正在尝试通过空手道将请求的主体键值添加为x-www-form-urlencoded
该示例中的最后一个“与请求”失败。
通过邮递员,我创建了一个有效的示例,可以为我们提供正确的答复。 (在下面导出了主要部分)
"item": [
{
"name": "http://www.google.com/api",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "our_xml",
"value": "<create_stuff> .... XML .... </create_stuff>",
"type": "text"
Scenario: XXX
Given url 'http://www.google.com/api'
And header Content-Type = 'application/x-www-form-urlencoded'
And request{"our_xml" : read('classpath:xml/post.xml')
答案 0 :(得分:0)
我认为您错过了ActionMailer::MailDeliveryJob
:https://github.com/intuit/karate#form-field的存在-标头将自动设置。
form field