Topic: Sending 'post' request to another site

Hi all,

This is probably a really simple question, but I'm a JS programmer who's new to Rails.

I have a blogging application which is proxied on my same domain that I'm going to want to be lightly coupled to my rails application. The blogging application (WordPress) normally handles its own login, but I'd like to log my user into that the moment they log into my rails app.

In JavaScript, it's easy to 'fake' the login request by simply POSTing the login information to the appropriate url. For example, I can use jQuery to do

jQuery.ajax({url: 'blog/?_login', type: "POST", data: {log:<username>,pwd:<password>}})

However, I want to do that on the server side, not the client side, for a number of reasons.

1) How do I do the equivalent of that POST on the server side? (It's possible that question seems meaningless to you -- I'm a server-side newbie!)

2) The request returns a cookie. How do I set the cookie in Rails? (The AJAX call sets it automatically)

Any help appreciated, thanks!


EDIT: Weird, does this site cut everything off after quotation marks?

Last edited by asbestos (2011-06-24 14:09:07)