11 messages in com.googlegroups.google-base-data-apipassing auth in the header and receiv...| From | Sent On | Attachments |
|---|---|---|
| richardko12 | 15 Mar 2007 23:15 | |
| Jeff S | 16 Mar 2007 11:25 | |
| richardko12 | 16 Mar 2007 12:51 | |
| Jeff S | 16 Mar 2007 15:40 | |
| richardko12 | 16 Mar 2007 17:00 | |
| richardko12 | 16 Mar 2007 17:27 | |
| Jeff S | 17 Mar 2007 16:15 | |
| richardko12 | 18 Mar 2007 18:27 | |
| joh...@gmail.com | 19 Mar 2007 08:19 | |
| richardko12 | 19 Mar 2007 10:52 | |
| joh...@gmail.com | 19 Mar 2007 11:27 |
| Subject: | passing auth in the header and receiving the data![]() |
|---|---|
| From: | richardko12 (cpca...@gmail.com) |
| Date: | 03/15/2007 11:15:50 PM |
| List: | com.googlegroups.google-base-data-api |
Hi,
I posted my message today before this but to no avail. I think I am passing the right headers to get the feed from google with this script:
global $itemsFeedURL,$developerKey; $ch = curl_init(); /* Create a CURL handle. */
curl_setopt($ch, CURLOPT_URL, $itemsFeedURL . "?"); curl_setopt($ch, CURLOPT_POSTFIELDS,"key=".urlencode("developerKey").""); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml', 'Authorization: auth="' . trim($auth) . '"' //'X-Google-Key: key=' . $developerKey ));
$result = curl_exec($ch); /* Execute the HTTP command. */ if($result) { echo "result: ".$result."\n"; }else{ echo "failure\n"; } curl_close($ch); /* Parse the resulting XML. */ $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); xml_parse($xml_parser, $result); xml_parser_free($xml_parser);
Its exactly similar to the example given in http://code.google.com/apis/base/samples/php/php-sample.html excep I am trying to use programmatic login instead of "Auth sub". I have tried this for a while but I cannot seem to get the item in my base. Any idea what I need to do to make this work.
Thanks ro




