OslcClient Locale (Accept-Language) [message #1488174] |
Wed, 26 November 2014 06:20  |
Eclipse User |
|
|
|
Would someone please provide me with sample code which sets the preferred Locale(s) for OslcClient requests?
I have a handle on the OslcClient object and I need to set the "Accept-Language" header sent within all OslcClient's HTTP request at run time. I know the OslcClient uses an HttpClient under the hood but I don't see any way to inject HTTP headers when a oslc resource is requested.
Thanks,
Matt
|
|
|
|
|
Re: OslcClient Locale (Accept-Language) [message #1718765 is a reply to message #1494721] |
Tue, 29 December 2015 17:59   |
Eclipse User |
|
|
|
Sam,
It works but it doesn't work for OslcOAuthClient's. I think someone needs implement an...
protected ClientResponse getResource(String url, Map<String, String> requestHeaders, String defaultMediaType)
throws IOException, OAuthException, URISyntaxException;
In the OslcOAuthClient class. Further, all the getResource() methods in the OslcClient class need their signatures updated to include the following throws...
throws IOException, OAuthException, URISyntaxException
I've attached my updates for this scenario. Most of the code is a copy of your OslcClient.getResource(String, Map, String) method.
Best regards,
Matt
|
|
|
|
Powered by
FUDForum. Page generated in 0.03170 seconds