[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

RFuzz::HttpClient hangs on meta refresh

atraver@gmail.com

7/10/2007 5:35:00 PM

I have to integrate some code with a client who uses SalesForce as its
CRM, and I've noticed something that might be RFuzz-related when
working with the request.

SalesForce's WebToLead service waits for HTTP POSTs to come in and
translates those into new entries in its system. If you do a curl as
such:

curl -d '' 'http://www.sales...servlet/servlet.WebT...

You'll get an empty response with a 200 status.

However, apparently SalesForce lets you provide a "retURL" key in the
request body, and it'll give you back a response with a meta refresh
tag:

curl -d 'retURL=http://www.googl... 'http://www.sales...
servlet/servlet.WebToLead'

The response will be something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="Refresh" content="0; URL=http://www.google.com...
</head>
<script>
if (window.location.replace){
window.location.replace('http://www.googl...);
} else {;
window.location.href ='http://www.googl...;
}
</script>
</html>

Whenever I try this through RFuzz's HttpClient, however, it hangs on
me:

uri = URI.parse('http://www.sales...servlet/servlet.WebT...)
client = RFuzz::HttpClient.new(uri.host, uri.port)
client.post(uri.path, :body => 'retURL=http://www.googl...) # <--
Hangs

Even when providing ":redirect => false" to client.post, it still
hangs.

Any ideas?

Thanks,
Adam