views:

8

answers:

0

I'm using Mechanize to try and login to http://fedex.com but doing so keeps returning this error:

405 => Net::HTTPMethodNotAllowed

Is that a response from fedex.com? Any ideas how to get around it?

Here's my Mechanize code:

agent = Mechanize.new { |a| a.log = Logger.new("mech.log") }
agent.user_agent_alias = 'Mac Safari'
page = agent.get('http://www.fedex.com/us/pckgenvlp/fcl/manage/myfedex/')
fedex_form = page.form('loginForm')
fedex_form.username = 'USERNAME'
fedex_form.password = 'PASSWORD'
page = agent.submit(fedex_form, fedex_form.buttons.first)