--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
request = given().
log().all().
auth().preemptive().basic("te...@test.com", "test123").
header("Host", HOST_HEADER).
header("user-agent", USER_AGENT).
header("accept", ACCEPT).
header("content-type", CONTENT_TYPE);
response = request.when().
post(ENDPOINT_FOR_LOGIN);response.then().statusCode(200);
Regards,
Vikram
Map<String, Object> params = new HashMap<>();
params.put("emailId", "te...@test.com");
params.put("password", "test123");
request = given().
log().all().
header("Host", HOST_HEADER).
header("user-agent", USER_AGENT).
header("accept", ACCEPT).
header("content-type", CONTENT_TYPE).
contentType(JSON).
body(params);
response = request.when().
post(ENDPOINT_FOR_LOGIN);
json = response.then().statusCode(200);
import static io.restassured.http.ContentType.JSON;<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
<scope>test</scope>
</dependency>Regards,Vikram
Hi Johan,I tried as below with preemptive auth but still getting 500? Is there a way to get more info from API why is it throwing error? Can you please clarify why body needs to be provided with rest assured in this caseThanks in advance
request = given().
log().all().
auth().preemptive().basic("test...@test.com", "test123").