{
"kind": "blogger#blog",
"id": "4871538073781423026",
"name": "SoffeeShop",
"description": "",
"published": "2012-10-24T23:55:32+09:00",
"updated": "2015-03-04T14:31:00+09:00",
"url": "http://soffeeshop.blogspot.com/",
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/4871538073781423026",
"posts": {
"totalItems": 58,
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/4871538073781423026/posts"
},
"pages": {
"totalItems": 0,
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/4871538073781423026/pages"
},
"locale": {
"language": "en",
"country": "",
"variant": ""
}
}
Although, when I do REST in the servlet in GAE, like
URL url = new URL("https://www.googleapis.com/blogger/v3/blogs/4871538073781423026?access_token=XXXXXXXXX");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("X-Appengine-Inbound-Appid", "XXXXX");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestProperty("Host", "googleapis.com");
or
URL url = new URL("https://www.googleapis.com/blogger/v3/blogs/4871538073781423026);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");connection.setRequestProperty("Authorization", "Bearer " + access_token); connection.setRequestProperty("X-Appengine-Inbound-Appid", "XXXXX");
connection.setRequestProperty("Accept", "application/json");
connection.setRequestProperty("Host", "googleapis.com");
i just got "404 Not Found" Error.
I could get access_token with OAuth2 using HttpURLConnection in the same servlet in GAE, just could not do access to google API's. So, it's mean Http Connections are working well to access to other servers.
Why I could not access only Google API's via servlet in GAE? Please help me...