search for: get_response

Displaying 20 results from an estimated 25 matches for "get_response".

2007 Jan 01
0
Net::HTTP.get_response with local files "file://..."
Hi, In my application I fetch a webpage with Net::HTTP.get_response(url). For creating a unit test I don''t want to be depended on an internet connection. So I tried to give an url like that: "file:///c:/mydir/mypage.html" (this url works in webbrower). But it seems that this is not the right protocol for Net::HTTP. Is there any possibility to...
2006 Jan 22
3
Download an Image using Net::HTTP
Hi, I need to download an image, and I''ve mucked about with Net::HTTP resp = Net::HTTP.get_response(''www.mydomain.com'', ''/test.jpg'') f = File.new("test.jpg","w") f.write(response.body) And various other combinations using HTTP.get etc. Anyway, I get an image, but it looks very psychedelic. This is obviously not the correct way. I also don...
2008 Apr 11
2
issues on Net:HTTP
in cotroller: @url=URI.parse(''http://google.com.sg/webhp'') @res = Net::HTTP.get_response(@clarifyurl) in view: <%=@res.body> this page displayed as 301 Moved The document has moved here what''s wrong with my code, I want to get the correct reponse HTML content from google. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are...
2013 May 07
2
Net::HTTP
...ng GET requests. But what''s the difference? When to use which? Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri response = http.request request # Net::HTTPResponse object end uri = URI(''http://example.com/index.html'') res = Net::HTTP.get_response(uri) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to thi...
2012 Mar 22
0
problems configuring cluster to lucci and virtual machines resource
...ult = self.application(environ, save_status_and_headers) File '/usr/lib/python2.6/site-packages/tw/core/middleware.py', line 43 in __call__ return self.wsgi_app(environ, start_response) File '/usr/lib/python2.6/site-packages/tw/core/middleware.py', line 68 in wsgi_app resp = req.get_response(self.application) File '/usr/lib/python2.6/site-packages/webob/__init__.py', line 1325 in get_response application, catch_exc_info=False) File '/usr/lib/python2.6/site-packages/webob/__init__.py', line 1293 in call_application app_iter = application(self.environ, start_response)...
2006 Nov 01
1
strange issue with backgroundrb behind apache/lighttpd
...the same data. i tested this by changing the request interval to 2 seconds and the counter now shows the correct values. but we have another problem. when testing with 2 or more people at the same time, we get the following error several times in the development log: Processing SearchController#get_responses (for 127.0.0.1 at 2006-11-01 07:47:07) [POST] Session ID: 671f4ba93603f34e036d9bbc65919ca7 Parameters: {"action"=>"get_responses", "controller"=>"search"} getting responses RangeError (0xdb677f22 is recycled object): (druby://localhost:42531...
2006 Feb 06
1
Check, and display, AIM status on rails page
...belong in a helper (such as app/helpers/application_helper.rb) # begin AIM helper methods def aim_signed_on(screen_name) require ''net/http'' host = "big.oscar.aol.com" path = "/#{screen_name}?on_url=online&off_url=offline" return true if Net::HTTP.get_response(host, path).header[''location''] == "online" end def display_aim_status(screen_name) if aim_signed_on(screen_name) screen_name + " is currently signed on AOL Instant Messenger" else screen_name + " is currently signed off of AOL Instant Messeng...
2007 Jan 31
2
SystemStackError: stack level too deep
...InstantRails/ruby/lib/ruby/1.8/net/http.rb:451:in `newobj'' from C:/InstantRails/ruby/lib/ruby/1.8/net/http.rb:451:in `newobj'' from C:/InstantRails/ruby/lib/ruby/1.8/net\http.rb:451:in `new'' from C:/InstantRails/ruby/lib/ruby/1.8/net\http.rb:374:in `get_response'' from C:/InstantRails/ruby/lib/ruby/1.8/net\http.rb:337:in `get_print'' from (irb):2 THX -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups &q...
2010 Oct 31
1
Rails application Webservices
hi all, I have a rails application at http://electric-sky-98.heroku.com/products require ''net/http'' require ''uri'' res = Net::HTTP.get_response(URI.parse(''http://electric- sky-98.heroku.com/products.xml'')) puts res.body the above code gave me the xml file below: <?xml version="1.0" encoding="UTF-8"?> <products type="array"> <product> <brand>Tubers</b...
2006 Jul 21
1
What''s wrong with this code?
...e with the flickr API to pull my photos into my site. I don''t want to use the "flickr.rb" gem, I''d like to do it the other way so I can learn (plus I had trouble loading the gem on my server). Anyway, here''s what I have: #Application.rb controller def get_response(path, http) request = Net::HTTP::Get.new(path) response = http.request(request) response.value response.body end path = "/services/rest/?api_key=API_KEY&method=flickr.photos.search&user_id=USER_ID&tags=TAG" http = Net::HTTP.new(''f...
2013 May 11
1
AMI Originate issue
...Context => 'users', Exten => 100, Priority =>1 }); sleep(2); my $response = $astman->get_response($resp_code); print $response->{'Response'} ."\n"; print $response->{'Message'} ."\n"; $astman->disconnect (); ####Script Output... *Error* *Extension does not exist* ---------------...
2005 Dec 20
1
Problems w/ Flickr demo
...39;' /opt/local/lib/ruby/1.8/net/http.rb:430:in `open'' /opt/local/lib/ruby/1.8/net/http.rb:430:in `do_start'' /opt/local/lib/ruby/1.8/net/http.rb:419:in `start'' /opt/local/lib/ruby/1.8/net/http.rb:296:in `get_by_uri'' /opt/local/lib/ruby/1.8/net/http.rb:282:in `get_response'' /opt/local/lib/ruby/gems/1.8/gems/flickr-1.0.0/./flickr.rb:82:in `http_get'' /opt/local/lib/ruby/gems/1.8/gems/flickr-1.0.0/./flickr.rb:66:in `request'' /opt/local/lib/ruby/gems/1.8/gems/flickr-1.0.0/./flickr.rb:142:in `method_missing'' /opt/local/lib/ruby/gems/...
2008 Mar 19
1
Database Triggered Events in Rails.
...on as a row appears in a database. Now in past implementations I''ve done the following. 1. Polled the database every 0.10 seconds. 2. If something was there to work, I''d tag it as complete. 3. Create a separate thread. (no further database hits will made) 4. Run my Net::HTTP.get_response(), which takes from 0.00001 to 600 seconds to complete. 5. Write output to some log file. What''s gotten me into trouble now, is I want to do touch the database. Which creates all sorts of havoc in rails when threaded. I''m pondering using BackgroundDB, but it looks like it'&...
2006 Jul 07
0
Net::HTTP.get_reponse issues ...
...#39;ResponseGroup'' => ''Small,Images'', ''SearchIndex'' => ''Music'', ''Artist'' => search_artist}.map { |key,value| "#{key}=#{value}"}.join("&") amazon_response = Net::HTTP.get_response(''webservices.amazon.co.uk'', ''/onca/xml?'' << amazon_params, 80) @xml = amazon_response.code end But it will only ever return a 500 - Internal Server Error response, yet if I type the URL in manually the response comes back as it should. This...
2006 May 06
0
`connect'': undefined method `verify_mode'' for nil:NilClass
...rt'' from /usr/lib/ruby/1.8/net/http.rb:544:in `start'' from /usr/lib/ruby/1.8/net/http.rb:1031:in `request'' from /usr/lib/ruby/1.8/net/http.rb:840:in `post'' from /usr/lib/ruby/gems/1.8/gems/payment-1.0.1/lib/payment/base.rb:52:in `get_response'' from /usr/lib/ruby/gems/1.8/gems/payment-1.0.1/lib/payment/authorize_net.rb:45:in `submit'' from test.rb:14 This is the test script I am trying to run: test.rb: -------- require ''rubygems'' require ''payment/authorize_net'' tr...
2006 May 23
0
FakeWeb test helper for Net::HTTP / open-uri web requests
...Web.register_uri("http://example.com/", :string => "Hello World") open("http://example.com/").string # => "Hello World" == Another Example FakeWeb.register_uri("http://example.com/", :response => `curl -i http://www.google.com/`) Net::HTTP.get_response("example.com", "/") # => Net::HTTPResponse equivalent to fetching http://www.google.com/ Versions 1.0.0 and 1.1.0 are available, the former works with Ruby 1.8.2, and the latter (and all subsequent releases) works with Ruby 1.8.4. See http://fakeweb.rubyforge.org/ for more...
2007 Dec 21
4
I need some guidance
I''m building an http communicator class for a web service API wrapper and I''m trying to go through the BDD process in doing so. I''m having a bit of a struggle figuring out how to set up the tests in relation to isolating things appropriately as well as testing behavior vs testing implementation. Specifically, I''m trying to set up a post method on my
2008 Jul 08
4
Checking URL with open-uri
Hi, I allow posting videos to youtube in my app. But before I let them save into the DB I want to, at least, know that the users put a link to youtube and that the link is working. How can I do those verifications with open-uri? Tried but got some errors... Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message
2008 Apr 30
1
Avelsieve 1.9.7 and Dovecot/TLS
...i, i'm installing a new mail server for our faculty and want to use the squirrelmail plugin 'avelsieve' (1.9.7). As documented on the dovecot wiki there is a problem in the STARTTLS code and i found a solution (that works for my installation): i've traced the server output in 'get_response' and instead of a script list i saw "IMPLEMENTATION". So i took a look at the file 'managesieve.lib.php' and the STARTTLS code: /* If we allow STARTTLS, use it */ if($this->capabilities['starttls'] === true && function_exists('stream_socket_enab...
2005 Sep 18
1
Timeout::Error (execution expired)
...itialize'' /usr/lib/ruby/1.8/net/http.rb:430:in `open'' /usr/lib/ruby/1.8/net/http.rb:430:in `do_start'' /usr/lib/ruby/1.8/net/http.rb:419:in `start'' /usr/lib/ruby/1.8/net/http.rb:296:in `get_by_uri'' /usr/lib/ruby/1.8/net/http.rb:282:in `get_response'' /usr/lib/ruby/gems/1.8/gems/flickr-1.0.0/./flickr.rb:82:in `http_get'' /usr/lib/ruby/gems/1.8/gems/flickr-1.0.0/./flickr.rb:66:in `request'' /usr/lib/ruby/gems/1.8/gems/flickr-1.0.0/./flickr.rb:142:in `method_missing'' /usr/lib/ruby/gems/1.8/gems/fl...