Monday, July 9, 2012

[YouTube-API] Re: Query URL working fine in browser but throwing InvalidEntryException : bad request from code. (setFields related)



El martes, 21 de junio de 2011 19:46:28 UTC+2, Jeffrey Posnick escribió:
Hello Mike,

 The spaces in your fields parameter's value aren't escaped anywhere,
leading to a malformed request URL. You should use "+" or "%20" to
escape them (which you're doing for cancer+treatment already).

Cheers,
-Jeff Posnick, YouTube API Team
~ YouTube is hiring! ~ http://google.com/jobs/workyoutube ~


On Jun 12, 7:37 pm, D Mike <veloph...@gmail.com> wrote:
> The query url:http://gdata.youtube.com/feeds/api/videos?q=cancer+treatment&fields=e...[yt:statistics/@viewCount>=30000
> and gd:rating/@numRaters>=3]
>
> ** I've narrowed the problem down to the " and " portion of the query,
> but I'm now completely stumped.
> The same query using only a single field is just fine, but once " and
> " gets involved, it breaks.
>
> Plenty of results in the browser, but using this java code throws the
> following exception:
>                 YouTubeQuery ytQuery = new YouTubeQuery(new URL(queryUrl));
>                 VideoFeed videoFeed = ytService.query(ytQuery, VideoFeed.class);
>
> Here is a partial stacktrace:
> com.google.gdata.util.InvalidEntryException: Bad Request
> <!DOCTYPE html>
> <html lang=en>
>   <meta charset=utf-8>
>   <title>Error 400 (Bad Request)!!1</title>
>   <style>
>      ...some huge mass of non-human-readable data here...
>   </style>
>   <a href=//www.google.com/id=g><img src=//www.google.com/images/
> logo_sm.gif alt=Google></a>
>   <p><b>400.</b> <ins>That's an error.</ins>
>   <p>Your client has issued a malformed or illegal request.
> <ins>That's all we know.</ins>
>
> This is a serious bummer, so advanced thanks for getting me going
> again!!
> Mike

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/JBgCtGzoqcQJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment