search for: httpok

Displaying 9 results from an estimated 9 matches for "httpok".

Did you mean: http
2012 Jul 23
2
Mechanize::Agent#post_connect_hook response != Mechanize#parse response
...ost_connect_hook will write to cache super end yield page if block_given? page end end It turns out that Mechanize#parse needs an instance of Mechanize::Headers for its `response` argument. But in post_connect_hook, the `response` argument is an instance of Net::HTTPOK. So: * I need to store enough information in the db cache so Mechanize#parse(uri, response, contents) can parse it. How do I convert a Net::HTTPOK into a Mechanize::Header? * Am I pursuing a fools errand? That is, has someone already implemented this in some lovely gem? [Minutia: There are lot...
2010 Jun 17
6
Foreman / external_node.rb
...foreman_url="https://hostname:443" require ''net/http'' foreman_url += "/node/#{ARGV[0]}?format=yml" url = URI.parse(foreman_url) req = Net::HTTP::Get.new(foreman_url) res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) } case res when Net::HTTPOK puts res.body else $stderr.puts "Error retrieving node %s: %s" % [ARGV[0], res.class] end ########################################################################## When I run it against a node, which I already took off the internal node definitions, I get the following error: /e...
2006 Mar 11
3
website monitor?
hi all. i have a site powered by ROR. now, i try to find a monitor based on ruby. any one have any idea? regards. -- Posted via http://www.ruby-forum.com/.
2007 Jun 10
0
pb when posting to an action "render_text body, :status => 400"
...#39;' url = "http://localhost:3000/test" uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) resp = http.post(uri.request_uri,"test") => Net::HTTPBadResponse: wrong status line: "HTTP/1.1 0 " if you do the same with webrick it works : => #<Net::HTTPOK 200 OK readbody=true> (I''m not sure webrick is right saying HTTP OK, when we asked to respond a 400 status, but it does not break the consumer client !) I didn''t find anything on this problem on google. I''m a newbie in ruby and rails, and a total newbie with mongre...
2007 Feb 26
1
some Mechanize objects never garbage collected?
...:List 5 | delta 5 WWW::Mechanize::Link 2 | delta 2 MatchData 2 | delta 1 Thread 2 | delta 1 WWW::Mechanize::Page 2 | delta 2 Net::HTTPOK 1 | delta 1 URI::HTTP 1 | delta 1 Net::HTTP 1 | delta 1 LoadError 1 | delta -1 Hpricot::Doc 1 | delta 1 W...
2008 Feb 26
1
A weird problem with open-uri
...both - the server and the console in dev.mode . When the "open" method is executed through the application it returns this objects as response: (inside open-uri lib). #<Net::HTTPNotFound:0x2aaaaea89890> When I call open in the console the response insite open-uri lib is: #<Net::HTTPOK:0x2aaaab48d570> System spec: Fedora 8 Rails 2.0.2 Ruby 1.8.6 I''ll appreciate any help about where the problem could be. 10x in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribe...
2006 Nov 04
0
Net::HTTP.post_form got 200 but no INSERT INTO. How come? How to fix this?
...::HTTP.post_form(URI.parse("http://localhost:3002/blog2/new"), {"commit" => "Save", "signature_id" => "", "signature_content" => "hey rails, it''s me ruby, your lover, why can you not insert me"}) => #<Net::HTTPOK 200 OK readbody=true> irb(main):014:0> Here''s the log (from rails) Processing Blog2Controller#new (for 127.0.0.1 at 2006-09-03 09:13:55) [POST] Session ID: 1629fe20fc50bebad043d8f6cb6a7a83 Parameters: {"commit"=>"Save", "action"=>"new&qu...
2011 Jun 27
12
Ruby script to download files without 'puppet agent'
We have often the Problem that some files need to be checked for updates faster than the cycle of the puppet agent. I try to solve this with a script which tries to download the files directly from the fileserver of the puppetmaster. So far i couldn''t get it to work. I don''t know if i got the URL right, i did not find any examples on the REST API documentation for the
2010 Jul 22
8
Foreman / External Nodes -- Node Not found
Hello All, So I finally got around to start to cut over node definitions from standard flat files to external nodes (foreman), and getting error message: "Error 400 on SERVER: Could not find node ''nodename''; cannot compile" - So basically it can''t pick up the node from the external node config. When I test the fetching of the yaml file it seems to work