首页 > 解决方案 > 如何放心发送-d信息?

问题描述

我正在尝试自动化一个需要发送 -d 信息的 api。

curl请求看起来像这样-

curl -X PUT "https://XXXXXXX.com/v1/YOLO/cccc/abc/mom" -H "accept: */*" -H "Content-Type: application/json" -d "[10035]"

我无法-d "[10035]"在请求中发送这部分。

需要放心,这就是我正在尝试的-

RequestSpecification request = given().filter(new RequestLoggingFilter(requestCapture));
        Response response =  request.auth().basic(XXX,XXX).body(Arrays.asList("10017")).contentType("application/json")
                .put(Chttps://XXXXXXX.com/v1/YOLO/cccc/abc/mom").then().extract()
                .response();

我感谢您的帮助。

标签: javarestcurlrest-assured

解决方案


Try to use

 curl --data-raw "[10035]" https://example.com

推荐阅读