Problem of trying to get gmail atom feed in ruby

C

Carfield Yim

I write some simple ruby code to try to get gmail atom feed:

http = Net::HTTP::new('mail.google.com', 443);
http.use_ssl = true ;
http.start {
request = Net::HTTP::Get.new('/mail/feed/atom"');
request.basic_auth(USERNAME,PASSWORD);
response = http.request(request)
response.value
puts response.body
}

But it is fail...

warning: peer certificate won't be verified in this SSL session
/usr/lib/ruby/1.8/net/http.rb:2097:in `error!': 400 "Bad
Request" (Net::HTTPServerException)
from /usr/lib/ruby/1.8/net/http.rb:2106:in `value'
from /home/carfield/respository/atomtest.rb:13
from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /home/carfield/respository/atomtest.rb:9

Anyone know how can I solve it? Done a brief google search doesn't
help...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top