location configuration

18 views
Skip to first unread message

Tony Akocs

unread,
Mar 24, 2022, 3:24:44 PM3/24/22
to REST assured
I have a curl command that I am trying to convert to a RestAssured call.

Here is the curl command that works.

curl https://www.mine.com/user
--key <pathToFile>/mine.rsa
--cert<pathToFile>/mine.pem
--cacert<pathToFile>/mine.trust.crt
--cookie SESSION
--cookie XSRF-TOKEN
--cookie-jar mine.cookies
--location
-H 'Accept:text/html, */*'

I'm want to configure the cookie, cookie-jar and location but I'm not sure I am doing it right.
Any help would be appreciated. Thanks

Here is my code

RestAssured.config = RestAssured.config().sslConfig(
sslConfig().with()
.truststore("truststore", "changeit")
.truststoreType("PKCS12")
.keystore("mine.p12", "changeit")
.keystoreType("PKCS12"));

Response response = given()
.cookie("SESSION")
.cookie("XSRF-TOKEN")
.accept(ContentType.HTML)
.when()
.get("https://www.mine.com/user")
.then()
.extract()
.response();

Reply all
Reply to author
Forward
0 new messages