We are trying to call a JSON based API using requestjs, but we're getting an error from the server.
request.get({
url: 'https://api.myapi.com',
timeout: 120000,
headers: {
username: 'myuser',
password: 'mypassword'
}
}, function (err, result) {
...
}
)
The error:
java.lang.IndexOutOfBoundsException: Index: 0
java.util.Collections$EmptyList.get(Collections.java:4454)
com.itemmaster.api.rest.svc.authentication.OpenSSOUserAuthServiceImpl.authenticate(OpenSSOUserAuthServiceImpl.java:159)
com.itemmaster.api.rest.profiler.SecurityProfiler.profile(SecurityProfiler.java:58)
While running the same call using curl returns without any issue.
curl --header "username:myuser" --header "password:mypassword" 'https://api.myapi.com'