(for the record: I am writing this mail without having read any answer to my
first one)

I have to correct myself here.

Zend_Rest_Client takes the name of the first called method as value for the
query parameter "method", so in this constellation the query (according to
the manual) would become sth. like "?method=method&arg1=
youtube.users.get_profile&method=youtube.users.get_profile&dev_id=YOUR_DEV_ID&user=USER_NAME
".
Obviously, not exactly the thing that youtube wants. Since the parameter
"method" exists twice in the query string, I know that an apache web server
would take the latter of both and the query would work nevertheless, but I
do not know how other web servers would handle this.

So, slightly offtopic but nevertheless, I think a new method called method()
should exist in Zend_Rest_Client to explicitly set the method parameter of a
query string. This should also be reserved to not be used in
Zend_Rest_Server.

JIRA Issue follows up tomorrow.

Cheers,
Tobias

2007/8/17, Tobias Gies <[EMAIL PROTECTED]>:
>
> Hi Greg,
>
> Try something like this:
>
> $client = new Zend_Rest_Client("http://www.youtube.com/api2_rest";);
> $response = $client->method("youtube.users.get_profile ")
>                    ->dev_id("YOUR_DEV_ID")
>                    ->user("USER_NAME")
>                    ->get();
>
> From there on, you should be able to handle $response like a SimpleXML
> Object.
>
> Greets,
> Tobias
>
> 2007/8/17, till <[EMAIL PROTECTED]>:
> >
> > On 8/17/07, Greg Freeman <[EMAIL PROTECTED] > wrote:
> > >
> > > I'm a little confused with zend rest. Could someone provide me with an
> > > example to connect to youtube's api?
> > >
> > > http://youtube.com/dev_rest
> > >
> > > Help appreciated thanks.
> >
> > IMO what Youtube does is not REST, they just call it REST. It's all
> > GET and pretty ugly too.
> >
> > Since you can send a request to the example url, why not try with
> > Zend_Http_Client?
> > http://www.youtube.com/api2_rest?method=youtube.users.get_profile&dev_id=YOUR_DEV_ID&user=YOUTUBE_USER_NAME
> >
> >
> > You can request that URL and in the body, you get the XML returned.
> > Then parse and off you are.
> >
> > Cheers,
> > Till
> >
>
>

Reply via email to