RFuzz::HttpClient hangs on meta refresh

Discussion in 'Ruby' started by Adam Traver, Jul 10, 2007.

  1. Adam Traver

    Adam Traver Guest

    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.salesforce.com/servlet/servlet.WebToLead'

    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.google.com' 'http://www.salesforce.com/
    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.google.com');
    } else {;
    window.location.href ='http://www.google.com';
    }
    </script>
    </html>

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

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

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

    Any ideas?

    Thanks,
    Adam
     
    Adam Traver, Jul 10, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nym Pseudo

    META NAME and META HTTP-EQUIV

    Nym Pseudo, Sep 26, 2003, in forum: HTML
    Replies:
    1
    Views:
    562
    =?iso-8859-1?Q?brucie?=
    Sep 26, 2003
  2. Zed Shaw
    Replies:
    0
    Views:
    144
    Zed Shaw
    Jul 10, 2006
  3. Zed Shaw
    Replies:
    0
    Views:
    112
    Zed Shaw
    Jul 28, 2006
  4. Zed Shaw
    Replies:
    6
    Views:
    147
    Alex Young
    Aug 6, 2006
  5. Zed Shaw
    Replies:
    0
    Views:
    88
    Zed Shaw
    Sep 18, 2006
Loading...

Share This Page