Is it possible to extract the method name from the

2019-07-10 15:15发布

I'm using REST-Assured in Java and here's how I'm getting my response object:

Response response = RestAssured.given().contentType(ContentType.JSON).header(header_name).get();

I want to know if there's any way to extract the method name used (GET in this case) from the response object.

1条回答
相关推荐>>
2楼-- · 2019-07-10 15:37

Incase if you're interested in knowing the requested method say GET or POST, below code will print the method on the console

given().log().method()
        .when()
        .get("https://www.google.co.in/").then().statusCode(200);

Hope this helps

查看更多
登录 后发表回答