[REBOL] Re: Blogger/REBOL XML-RPC
From: chaz:innocent at: 19-Aug-2001 10:31
>Can you trap exactly what you are sending, headers and all, and post what
>you are sending?
That sounds like a reasonable request, however, at this moment, I'm not
sure how to do that.
Below is a document by the creator of the API.
Maybe a more basic question is "how do I send and receive these xml
messages using REBOL?"
http://plant.blogger.com/api/xmlrpc_getUsersBlogs.html
blogger.getUsersBlogs via XML-RPC
By Evan Williams, 8/13/01
blogger.getUsersBlogs returns information about all the blogs a given user
is a member of. Data is returned as an array of <struct>'s containing the
ID (blogid), name (blogName), and URL (url) of each blog.
URI
All XML-RPC requests should go to the following URI:
http://plant.blogger.com/api/RPC2
Note: This could (and, likely, will) change at some point! (Due warning
will be given.)
Parameters
blogger.getUsersBlogs takes the following parameters. All are required:
appkey (string): Unique identifier/passcode of the application sending the
post. (See access info.)
username (string): Login for the Blogger user who's blogs will be retrieved.
password (string): Password for said username.
Examples
Here is an example of an XML-RPC call to blogger.getUsersBlogs:
POST /api/RPC2 HTTP/1.0
User-Agent: Java.Net Wa-Wa 2.0
Host: plant.blogger.com
Content-Type: text/xml
Content-length: 515
<?xml version="1.0"?>
<methodCall>
<methodName>blogger.getUsersBlogs</methodName>
<params>
<param><value><string>C6CE3FFB3174106584CBB250C0B0519BF4E294</string></value
></param>
<param><value><string>ewilliams</string></value></param>
<param><value><string>secret</string></value></param>
</params>
</methodCall>
Here is an example methodResponse with no errors:
HTTP/1.1 200 OK
Connection: close
Content-Length: 125
Content-Type: text/xml
Date: Mon, 6 Aug 20001 19:55:08 GMT
Server: Java.Net Wa-Wa/Linux
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<struct>
<member>
<name>url</name>
<value>http://stuff.foo.com/biz</value>
</member>
<member>
<name>blogid</name>
<value>2997323</value>
</member>
<member>
<name>blogName</name>
<value>Blogger Biz Dev</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>url</name>
<value>http://www.blogger.com/</value>
</member>
<member>
<name>blogid</name>
<value>2723</value>
</member>
<member>
<name>blogName</name>
<value>Blogger News</value>
</member>
</struct>
<value>
<struct>
<member>
<name>url</name>
<value>http://www.geocities.com/rafting/</value>
</member>
<member>
<name>blogid</name>
<value>223723</value>
</member>
<member>
<name>blogName</name>
<value>RaftingBlog</value>
</member>
</struct>
</value>
</value>
</data>
</array>
</value>
</param>
</params>
</methodResponse>
Errors
Errors are returned as an XML-RPC <methodResponse> with a <fault> item,
containing a <struct> with a faultCode and a faultString, as defined by the
XML-RPC spec.
Here an example response for an unsuccessful post. This error is due to a
bad username/password combo:
HTTP/1.1 200 OK
Connection: close
Content-Length: 225
Content-Type: text/xml
Date: Mon, 6 Aug 20001 19:55:08 GMT
Server: Java.Net Wa-Wa/Linux
<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>4</int></value>
</member>
<member>
<name>faultString</name>
<value><string>java.lang.Exception: java.lang.Exception:
Error: User
authentication failed: ewilliams</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
At 09:09 AM 8/19/01 -0500, you wrote: