Thanks 2009/3/25 Jeremy Geerdes <[email protected]>
> Yes, the same basic coding principles would work to send a POST request to > the translation API. None of the other API services accept POST requests, > though. > > Jeremy R. Geerdes > Effective website design & development > Des Moines, IA > > For more information or a project quote: > http://jgeerdes.home.mchsi.com > http://jgeerdes.blogspot.com > http://jgeerdes.wordpress.com > [email protected] > > Unless otherwise noted, any price quotes contained within this > communication are given in US dollars. > > If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan > Church! > > And check out my blog, Adventures in Web Development, at > http://jgeerdes.blogspot.com ! > > > On Mar 24, 2009, at 8:59 PM, Jose Mora Fallas wrote: > > i've seen this code in another post: > $url = " > http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton > "; > > // sendRequest > // note how referer is set manually > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $url); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > curl_setopt($ch, CURLOPT_REFERER, "http://www.serate-italiane.dk/index.php > "); > $body = curl_exec($ch); > curl_close($ch); > > // now, process the JSON string > $json = json_decode($body); > // now have some fun with the results... > > ?> > > > Since I am using an earlier version og php5.2, I am adviced to use the > following functions, together with the *Services/JSON.php* script > > > > <?php > if ( !function_exists('json_decode') ){ > function json_decode($content, $assoc=false){ > require_once 'Services/JSON.php'; > if ( $assoc ){ > $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); > } else { > $json = new Services_JSON; > } > return $json->decode($content); > } > } > > if ( !function_exists('json_encode') ){ > function json_encode($content){ > require_once 'Services/JSON.php'; > $json = new Services_JSON; > > return $json->encode($content); > } > } > ?> > > Could i do procesing the ajax translation results using post method in the > same way? > > > -- > _________________________ > Jose Manuel Mora Fallas > www.acto.go.cr > > > > > > > > -- _________________________ Jose Manuel Mora Fallas www.acto.go.cr --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-AJAX-Search-API?hl=en -~----------~----~----~----~------~----~------~--~---
