Karate 如何在空手道中传递x-www-form-urlencoded-grant\u type=client\u凭证

Karate 如何在空手道中传递x-www-form-urlencoded-grant\u type=client\u凭证,karate,Karate,如何在空手道中传递x-www-form-urlencoded-grant_type=client_凭证 嗨 我正试图以空手道编码的x-www-form-url形式传递value grant\u type=client\u凭证,这是我和邮递员一起做的 我知道空手道会默认将内容类型设置为x-www-form-urlencoded,但是你能帮我解决我这里的错误吗 空手道脚本: enter code here Given url 'http://env/singlesignon/v1/access/

如何在空手道中传递x-www-form-urlencoded-grant_type=client_凭证

我正试图以空手道编码的x-www-form-url形式传递value grant\u type=client\u凭证,这是我和邮递员一起做的

我知道空手道会默认将内容类型设置为x-www-form-urlencoded,但是你能帮我解决我这里的错误吗

空手道脚本:

enter code here
  Given url 'http://env/singlesignon/v1/access/token'
 And header Authorization = 'Basic c2JsLWFwaWdlZS1lemJvYi1jbGllbnQ6c2JsLWFwaWdlZGllbnQ='
 And header X-Correlation-Id = 'alibgefh'

 And header X-Consumer = 'APIGEE'

 And form field grant_type = 'client_credentials'

 When method post

 Then status 200
请求标头:

enter code here
 Authorization: Basic c2JsLWFwaWdlZS1lemJvYi1jbGllbnQ6c2JsLWFwaWdlZGllbnQ=
 Connection: Keep-Alive
 Content-Length: 29
 Content-Type: application/x-www-form-urlencoded; charset=UTF-8
 X-Consumer: APIGEE
 X-Correlation-Id: alibgefh
答复:


{“error\u description”:“error Content Type”,“error”:“Bad Request”}

也许您的服务器不喜欢
charset=UTF-8
部分(这是您服务器上的一个错误)。请尝试在以下操作之前添加此行:

* configure charset = null

否则,您的问题中没有足够的数据。如果可能,与服务器端团队中的某个人合作。您可以尝试使用工作cURL命令编辑您的问题,这可能会有所帮助。

可能您的服务器不喜欢
charset=UTF-8
部分(这是您服务器上的一个错误)。请尝试在以下操作之前添加此行:

* configure charset = null

否则,您的问题中没有足够的数据。如果可能,与服务器端团队中的某个人合作。您可以尝试使用工作cURL命令编辑您的问题,这可能会有所帮助。

@Siva great,请阅读以下内容:@Siva great,请阅读以下内容: