请放心,无法获取本地主机url为的令牌



我是使用放心测试的新手。在邮差中,它运行良好,可以退还代币。但是,当我使用放心来获得令牌时,它在状态代码中返回404;错误":"未经授权的";体内反应。这是我的代码

RequestSpecification request = RestAssured.given();
Response res = request
//.contentType("application/json")
.queryParam("username", "uname")
.queryParam("password", "password")
.queryParam("cliend_id", "android")
.queryParam("grant_type", "password")
.queryParam("scope", "trust")
.post("http://localhost:8080/com.abcde.webservices/oauth/token");
System.out.println("Response : "+res.asString());
System.out.println(res.getStatusCode());

我已经尝试使用

RestAssured.baseURI = "http://localhost:8080/com.abcde.webservices";
.....
.post("/oauth/token");

但仍然无法获得代币

我刚刚意识到我在clint_id中输入错误。我键入cliend_id,它应该是client_id。我更换后一切都很好。

最新更新