Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top