休息保证 - {“成功”: - 1,“msg”:“意外字符('%'(代码37)):预期有效值

时间:2018-06-18 03:34:30

标签: java rest

我正在尝试使用RestAssured从GET请求中读取响应,但我在日志中收到以下错误:

{"success":-1,"msg":"Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]"}

休息代码:

    private Response setRestAssured(String uri) {
        RestAssured.baseURI = uri;

        Response res  =given ()
                .headers("Content-Type", ContentType.JSON, "Accept", ContentType.JSON)
                .when()
                .get ("?ReqData=%7B%22latValue%22%3A39.7392358%2C%22longValue%22%3A-104.990251%2C%22productHash%22%3A7%2C%22clinicHash%22%3A3%2C%22radius%22%3A500%7D")
                .then()
//                .contentType("application/x-JavaScript")
                .extract().response();

        return res;
    }

我该如何解决这个问题?

0 个答案:

没有答案