wwHttp is what you want to grab XML content off the Web... wwXML also has basic HTTP features but they just delegate to wwhttp so I always recommend using the more complete wwHTTP features just in case you need more functionality later.
+++ Rick ---
To close this off post off, I think I go understand how to tackle this, from reading Rick's help file a bit closer.
Looks like this is child's play (to quote Rick in his help file) using the wwHTTP class. Alternatively, it looks like wwSockets would work too.
Greg
More specifically, this questions pertains to the google/youtube api. Is the proposed OHTTP.send() call appropriate for sending information as follows, with the XML being constructed using pure foxpro code
such as TEXT to lcXML NOSHOW, or is encoding also required which involves wwXML:
YouTube call example as follows:
POST /action/GetUploadToken HTTP/1.1
Host: gdata.youtube.com
Authorization: AuthSub token="DXAA...sdb8"
GData-Version: 2
X-GData-Client: b1c4t9sl2159
X-GData-Key: key=adf15ee97731bca89da876c...a8dc
Content-Length: 1941255
Content-Type: application/atom+xml; charset=UTF-8
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:yt="http://gdata.youtube.com/schemas/2007">
<media:group>
<media:title type="plain">Bad Wedding Toast</media:title>
<media:description type="plain">
I gave a bad toast at my friend's wedding.
</media:description>
<media:category
scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People
</media:category>
<media:keywords>toast, wedding</media:keywords>
</media:group>
</entry>
Hi All,
I am wanting to call the google api, which uses xml calls.
The calls require POST, GET and PUT.
Google presents the basic xml tag requirements to make the calls.
I have noticed in Rick's message board that wwXML is not typically used to construct new xml files when the only data available is sample xml code.
In one write up Rick manually constructing the xml string using
TEXT to lcXML NOSHOW
*hard coded xml tags (unsure if white space matters here,
in manually constructing the xml tags CR + LF?
and then follows code:
oHTTP = createobject("Microsoft.XMLHTTP")
oHTTP.Open("POST", "http:/www.example.com/pubs", .f.)
oHTTP.SetRequestHeader("Content-Type", "text/xml")
oHTTP.Send(lcXML)
oHTTP.oHTTP.responseXML
and follows with looped code through the returned oXML object using oXML.SelectNodes("/pubs/author")
My question is: is this pretty much general approach that one could take to interface with Google? And secondly, is XML sensitive whitespace and tabs?
Also, are CR's and LF's significant?
Thanks for any comments.
Greg
| Rick Strahl West Wind Technologies Where do you want to surf today? | Reader Version: 5.0 |
from Maui, Hawaii
