def self.open_url(url, user, password)
begin
return open(url, :http_basic_authentication=>[user, password], "Accept" => "application/xml").read
rescue Exception=>e
#p e.message
puts "Failed to parse url : #{url}"
return "<failed/>"
end
end
And my test method (web mock/respec) content:
@user = "login"
@pwd = "pwd"
@base64_code = Base64.encode64("#{@user}:#{@pwd}").delete("\n")
uri = "https://api.appannie.com/v1/accounts/blabla"
raw_response_file = load_fixture("app_annie_ok.txt")
stub_request(:get, uri).with(:headers => {"Authorization" => "Basic "+ @base64_code}).to_return(raw_response_file)
I also try:
uri = "#{@user}:#{@pwd}@api.appannie.com/v1/accounts/blabla"
raw_response_file = load_fixture("app_annie_ok.txt")
stub_request(:get, uri).with(:headers => {"Authorization" => "Basic "+ @base64_code}).to_return(raw_response_file)
All without success.
Anyone have an idea ?
Thanks
--
---
You received this message because you are subscribed to the Google Groups "webmock-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webmock-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.