I have API which is using accesstoken as Header key and Value in Rest Assured
Response response = httpRequest.request(Method.POST);
//4. get the response body:
String responseBody = response.getBody().asString();
httpRequest.headers("accesstoken", "pbnQiOiIxMjM0NSJ9.");
System.out.println("Response Body is: "+ responseBody);
//validate city name or validate the key or value
//Assert.assertEquals(responseBody.contains(city), true);
//5. get the status code and validate it:
int statusCode = response.getStatusCode();
System.out.println("the status code is: "+ statusCode);
Assert.assertEquals(statusCode, TestUtil.RESPONSE_CODE_200);
When I run the Rest Assured code, error message as 400.