请放心使用-使用ntlm / windows身份验证发送Java的休息请求失败
(401-未经授权:由于无效的凭据而拒绝访问。)
提示:我正在放心:4.0.0
我试图添加标题,但是也失败了。
RequestSpecification request = RestAssured.given().auth().ntlm(username, password, domain, computerName);
// RequestSpecification request =
// RestAssured.given().auth().ntlm(username,password,"eame","TAshrf-10-8103");
JSONObject requestParams = new JSONObject();
requestParams.put(param1, "value1"); // Cast
requestParams.put("param2", "value2");
System.out.println("send parameters");
// request.body(requestParams.toJSONString());
String req = request.body(requestParams.toJSONString()).toString();
System.out.println(req);
Response response = request.get();
String responseBody = response.getBody().asString();
System.out.println("Response Body is => " + responseBody);
响应应为200