[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

xml-rpc 302 error handling?

cooper bethea

5/19/2005 1:28:00 PM

Hi everybody -

I've been playing with 37signals' new Backpack XML-RPC API -
http://www.backpacki... - and it's giving me a bit of a problem.
Apparently my use of XMLRPC::Client#call returns a RuntimeError that
contains ""HTTP-Error: 302 Found" but no URI to redirect to. Is there a
way to work around this? I've pasted code below - note that if you just
plug this in and try it it won't work for you; the xml api requires an
sha-1 hash supplied with "token".

Any suggestions?

--
#!/usr/local/bin/ruby

require 'xmlrpc/client'
require 'rexml/document'

token = ''

headers = Hash.new
headers['X-POST_DATA_FORMAT'] = 'xml'

server = XMLRPC::Client.new("cooper.backpackit.com",
"/ws/tags/select/3165")
server.http_header_extra = headers

begin
tags = server.call("token", token)
rescue RuntimeError => e
p e.message
end

p tags
--



1 Answer

Adam Keys

5/24/2005 3:34:00 AM

0

On May 19, 2005, at 8:28 AM, cooper bethea wrote:

> Hi everybody -
>
> I've been playing with 37signals' new Backpack XML-RPC API -
> http://www.backpacki... - and it's giving me a bit of a
> problem. Apparently my use of XMLRPC::Client#call returns a
> RuntimeError that contains ""HTTP-Error: 302 Found" but no URI to
> redirect to. Is there a way to work around this? I've pasted code
> below - note that if you just plug this in and try it it won't work
> for you; the xml api requires an sha-1 hash supplied with "token".
>
> Any suggestions?


That's quite the novel use of xmlrpc4r. Any reason you're doing that
rather than using Net::HTTP directly or the Backpack wrapper that was
posted by why?

http://www.whytheluckystiff.net/ruby/b...

--
~akk
http://there...