Also, excuse me if my issue is a little bit application-specific. I need Mechanize to submit bunch of data from our server to an online reservation system. The url ishttp://hajres.iranair.com/haj/request.php" It works in my browser however, using mechanize following error appears:>> agent.get("http://hajres.iranair.com/haj/request.php")Net::HTTP::Get: /haj/request.php request-header: accept-language => en-us,en;q=0.5 request-header: accept => */* request-header: user-agent => WWW-Mechanize/1.0.0 ( http://rubyforge.org/projects/mechanize/) request-header: connection => keep-alive request-header: accept-encoding => gzip,identity request-header: cookie => PHPSESSID=pf1qrf54our96oup7ofei385n3 request-header: host => hajres.iranair.com request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 request-header: keep-alive => 300 Read 72 bytes response-header: x-powered-by => PHP/5.2.5 response-header: expires => Thu, 19 Nov 1981 08:52:00 GMT response-header: content-type => text/html; charset=cp-1256 response-header: connection => close response-header: server => Apache/2.2.8 (Fedora) response-header: date => Wed, 20 Oct 2010 19:21:53 GMT response-header: content-length => 72 response-header: cache-control => no-store, no-cache, must-revalidate, post-check=0, pre-check=0 response-header: pragma => no-cache status: 500 Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError from /Library/Ruby/Gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:259:in `get'' from (irb):26 Could you realize what is wrong? p.s. I also changed agent type. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20101021/7b22f07b/attachment.html>
Visiting the site in a web browser, it looks like it''s not responsive right now. Which makes sense, given that you''re getting an error 500. That''s an http error code: 10.5.1 500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. On Wed, Oct 20, 2010 at 4:00 PM, Hosein Shafiei <hs.shafiei at gmail.com>wrote:> Also, excuse me if my issue is a little bit application-specific. I need > Mechanize to submit bunch of data from our server to an online reservation > system. The url ishttp://hajres.iranair.com/haj/request.php" > It works in my browser however, using mechanize following error appears: > > >> agent.get("http://hajres.iranair.com/haj/request.php") > Net::HTTP::Get: /haj/request.php > request-header: accept-language => en-us,en;q=0.5 > request-header: accept => */* > request-header: user-agent => WWW-Mechanize/1.0.0 ( > http://rubyforge.org/projects/mechanize/) > request-header: connection => keep-alive > request-header: accept-encoding => gzip,identity > request-header: cookie => PHPSESSID=pf1qrf54our96oup7ofei385n3 > request-header: host => hajres.iranair.com > request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 > request-header: keep-alive => 300 > Read 72 bytes > response-header: x-powered-by => PHP/5.2.5 > response-header: expires => Thu, 19 Nov 1981 08:52:00 GMT > response-header: content-type => text/html; charset=cp-1256 > response-header: connection => close > response-header: server => Apache/2.2.8 (Fedora) > response-header: date => Wed, 20 Oct 2010 19:21:53 GMT > response-header: content-length => 72 > response-header: cache-control => no-store, no-cache, must-revalidate, > post-check=0, pre-check=0 > response-header: pragma => no-cache > status: 500 > Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError > from /Library/Ruby/Gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:259:in > `get'' > from (irb):26 > > Could you realize what is wrong? > p.s. I also changed agent type. > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20101020/7c443c88/attachment-0001.html>
I realized It only works with IE and Chrome other browsers return 500 error. So I changed agent_alias using :>> agent.user_agent_alias = "Windows IE 6"=> "Windows IE 6" again no luck ! could anyone please help me. On Thu, Oct 21, 2010 at 2:27 AM, James <oscartheduck at gmail.com> wrote:> Visiting the site in a web browser, it looks like it''s not responsive right > now. > > Which makes sense, given that you''re getting an error 500. That''s an http > error code: > > 10.5.1 500 Internal Server Error > > The server encountered an unexpected condition which prevented it from > fulfilling the request. > > On Wed, Oct 20, 2010 at 4:00 PM, Hosein Shafiei <hs.shafiei at gmail.com>wrote: > >> Also, excuse me if my issue is a little bit application-specific. I need >> Mechanize to submit bunch of data from our server to an online reservation >> system. The url ishttp://hajres.iranair.com/haj/request.php" >> It works in my browser however, using mechanize following error appears: >> >> >> agent.get("http://hajres.iranair.com/haj/request.php") >> Net::HTTP::Get: /haj/request.php >> request-header: accept-language => en-us,en;q=0.5 >> request-header: accept => */* >> request-header: user-agent => WWW-Mechanize/1.0.0 ( >> http://rubyforge.org/projects/mechanize/) >> request-header: connection => keep-alive >> request-header: accept-encoding => gzip,identity >> request-header: cookie => PHPSESSID=pf1qrf54our96oup7ofei385n3 >> request-header: host => hajres.iranair.com >> request-header: accept-charset => ISO-8859-1,utf-8;q=0.7,*;q=0.7 >> request-header: keep-alive => 300 >> Read 72 bytes >> response-header: x-powered-by => PHP/5.2.5 >> response-header: expires => Thu, 19 Nov 1981 08:52:00 GMT >> response-header: content-type => text/html; charset=cp-1256 >> response-header: connection => close >> response-header: server => Apache/2.2.8 (Fedora) >> response-header: date => Wed, 20 Oct 2010 19:21:53 GMT >> response-header: content-length => 72 >> response-header: cache-control => no-store, no-cache, must-revalidate, >> post-check=0, pre-check=0 >> response-header: pragma => no-cache >> status: 500 >> Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError >> from /Library/Ruby/Gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:259:in >> `get'' >> from (irb):26 >> >> Could you realize what is wrong? >> p.s. I also changed agent type. >> >> _______________________________________________ >> Mechanize-users mailing list >> Mechanize-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mechanize-users >> > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20101021/18cade2b/attachment.html>