belaidHUB / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

com.google.gdata.util.ParseException: Unrecognized content type:application/json;charset=UTF-8 #861

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.47.1-rc)?

Java environment (e.g. Java 7)?

Hi,

I am trying to get a videoFeed using the below link -

https://gdata.youtube.com/feeds/api/videos?q=roomba&v=2&alt=jsonc

When I directly paste this link into browser, I get the JSON format of the 
video, however when I am trying it through a java code using below line of code 
-

List<VideoEntry> videoEntries = service.getFeed(query.getFeedUrl(), 
VideoFeed.class).getEntries();

I am getting an error -

com.google.gdata.util.ParseException: Unrecognized content 
type:application/json;charset=UTF-8
    at com.google.gdata.client.Service.parseResponseData(Service.java:2136)
    at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
    at com.google.gdata.client.Service.getFeed(Service.java:1136)
    at com.google.gdata.client.Service.getFeed(Service.java:998)
    at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:645)
    at com.google.gdata.client.Service.getFeed(Service.java:1017)

Can anyone please let me know how to get a JSON Video Feed using JAVA and 
YouTube API ?

Best Regards,
Veeresh

Original issue reported on code.google.com by samarthv...@gmail.com on 12 Mar 2014 at 5:20