I am new to rest assured testing. I am doing authentication using cookies and the GET call is returning a 200 status but when i am doing a delete, i am getting 302. What am i doing wrong?
This works-
public void Getcall(String id){
RestAssured.useRelaxedHTTPSValidation();
String c= driver.manage().getCookies().toString();
Response response= RestAssured.given().when().baseUri("service url"+id).cookie(c).**get**
().then().extract().response();
System.out.println(response.getStatusCode());
}
This does not work- (gives 302)
public void softDeleteCal(){
RestAssured.useRelaxedHTTPSValidation();
String c= driver.manage().getCookies().toString();
Response response= RestAssured.given().when().baseUri("service url"+id").cookie(c).**delete**
().then().extract().response();
System.out.println(response.getStatusCode());
}
This is format of cookie from the chrome developers console> network tab Cookie: VCAP_ID=fdf425dd-80e3-4820-757b-73c6; JSESSIONID=AA5B704E5DC85CACEADFF09D61084A06