Frage

I need to put following rest request using restlet client:

GET
https://www.xyz.com/resource/blah/
Authorization: Bearer XToken

I am able to get the XToken in a separate call, but in the presented call i am unable to set the 'Authorization' header in my ClientResource object.

Can somebody suggest me what code needs to be added for the following line of code that i have:

clientResource.setChallengeResponse(new ChallengeResponse(ChallengeScheme.XXXX, bearerToken)

Creating and adding 'Authorization' header in restlet is giving me errors from restlet client library.

thanks in advance

Ashish Sharma

War es hilfreich?

Lösung

Restlet client library ver. 2.0.X is still very counter intuitive and lacks documentation.

So dumped it and started using HTTP Components HttpClient ver. 4.2.2, it was a breeze as compared to restlet client library, it's way much better than restlet client.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top