如何在空手道API中为GET方法提供JSON请求正文 [英] How to provide JSON request body for GET method in Karate API

查看:54
本文介绍了如何在空手道API中为GET方法提供JSON请求正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用空手道API为GET方法提供请求正文.

How to provide request body for GET method using Karate API.

当尝试在Karate API中为Get方法提供请求正文时,它不接受请求并抛出500个状态代码.

When trying to provide Request body for Get method in Karate API, it doesnt take the request and throws 500 status code.

推荐答案

HTTP GET中所述带有请求正文不建议在GET请求中使用请求主体来更改请求的语义.

As stated in HTTP GET with request body using the request body within a GET request to change the semantics of the request is highly discouraged.

空手道在使用方法GET 时忽略消息正文是有争议的,如果您认为该功能存在用例,则可以免费提交

It's debatable that Karate ignores the message body when using method GET and if you think there is a use case for that feature your free to file an issue.

此外,由于缺少消息正文,被测系统返回了您观察到的 500 状态码,与空手道无关.

Furthermore, the 500 status code you observe is returned by your system under test because of the missing message body and has nothing to do with karate.

确认空手道1.0 可以支撑身体GET

confirmed that Karate 1.0 will support a body along with a GET

这篇关于如何在空手道API中为GET方法提供JSON请求正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆