我尝试使用具有保证保证的响应的ntlm身份验证自动执行剩余获取请求:401相同的请求通过邮递员传递吗?

时间:2019-05-28 11:40:25

标签: java api postman rest-assured ntlm-authentication

请放心使用-使用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

0 个答案:

没有答案