search for: httpsuccess

Displaying 5 results from an estimated 5 matches for "httpsuccess".

Did you mean: http_access
2006 Sep 13
1
Net::HTTPResponse
Hello :) I have a problem with the Net::HTTP library... The Net::HTTP library [1] uses a Net::HTTPResponse object for all it''s responses from web servers. This class has many subclasses, such as HTTPSuccess, HTTPRedirecttion, etc. When obtaining a response, the library suggests to check what it is by testing the class of the returned object - using case/when or kind_of? (which it does internally) So I need a mock object which can pass for a Net::HTTPResponse. However I can''t create a Net:...
2007 Oct 05
3
basic_auth problem since 0.6.9
I have a site that I don''t think "returns" a basic_auth request, but is able to use basic_auth. In the past on 0.6.8, I could use the following code: require ''rubygems'' # gem ''mechanize'', ''=0.6.8'' require ''mechanize'' agent = WWW::Mechanize.new agent.basic_auth("username", "password")
2008 May 03
0
marshalling mechanized
...et". basically, don''t try to marshal a socket. however, if we make sure to finish the http connection after each use, then the agent can be marshalled safely. i accomplished this by inserting: http_obj.finish immediately prior to this line: return page if res_klass <= Net::HTTPSuccess in mechanize.rb, which is approximately line 587 in v 0.7.0 this is a crude hack that doesn''t, i think, respect keep-alive connections, but it does at least work for the purpose of ensuring the agent can be marshalled. i invite thoughts on more elegant solutions! nick
2012 May 25
1
Connect reset by peer error
...uth_code'' => @code, ''client_id''=>''my_client_id'', ''client_secret''=>''my_secret_key''}, '';'') res = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) } case res when Net::HTTPSuccess, Net::HTTPRedirection # OK else # res.error! end render :text => @code.inspect end I get a valid authorization code but unable to proceed to get access token due to above error. The third party API has to return a response in json format. Any help is much awaited and a...
2013 Mar 07
3
Expected response to be a <:redirect>, but was <200>
Hey i am new to testing on rails and i have the following test written describe ''GET search'' do it ''finds a named account directly'' do get :search, name: ''test'' expect(response).to redirect_to(account_path(''test'')) end I have been getting the following error SystemAccountsController GET search finds a