I am using rest-assured to automate a Rest Get Call and getting below error:
Illegal character in query at index 138:
try {
result = java.net.URLEncoder.encode("http://localhost:8080/", StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
System.out.println("xyz");
}
request= given().log().all().spec(requestHeader_abc())
.queryParam("response_type", "code")
.queryParam("client_id","***7")
//.queryParam("redirect_uri", encodeValue("http://localhost:8080/"))
.urlEncodingEnabled(false).queryParam("redirect_uri", "http://localhost:8080/")
//.queryParam("redirect_uri", result)
.queryParam("max_age",0)
.queryParam("scope","profile p1:read:user");
response = request.when()
.get(pingResources.getResources())
.then()
.log().all()
.extract().response();
Error: Caused by: java.net.URISyntaxException: Illegal character in query at index 138:
What could be possible fix, am I handling"redirect_uri" wrongly??