Thanks for the link. It was helpful in logging what was being sent and received actually.
Below is the output:-
1 * Out-bound request 1 > GET https://apikey:password@prashant-store.myshopify.com/admin/collects.json 1 > Accept: application/json 1 > 1 < 401 1 < X-Shopify-Asset-Version: <some Version number> 1 < X-ShopId: <some id number> 1 < X-ShardId: 0 1 < Set-Cookie: _secure_admin_session_id=<some id number>; path=/; secure; HttpOnly 1 < Transfer-Encoding: chunked 1 < Content-Type: application/json; charset=utf-8 1 < Status: 401 Unauthorized 1 < X-Request-Id: <some id number> 1 < Date: Mon, 23 Dec 2013 12:47:45 GMT 1 < Server: nginx 1 < X-UA-Compatible: IE=Edge,chrome=1 1 < WWW-Authenticate: Basic Realm="Shopify API Authentication" 1 < {"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"} 1 * In-bound response
I even tried again & again with new apikeys/password but of no avail.
(However, HTTPClient is producing OK results with those apikeys and passwords.)
I even re-read whole URI class, modified code as -
String url = "https://apikey:password@prashant-store.myshopify.com/admin/collects.json"; URI uri = new URI(url); WebResource loginService = client.resource(uri);
& checked the existing URI with getAuthority(), getUserInfo(), getPath(), getScheme(), getSchemeSpecificPart() methods to see if URI part is correct.
..dunno from where problem is arising?