Hi, Prabhu.
I advice you to use Http Analyzer to figure out what you need to implement. Learn requests in analyzer during signing out and you'll find out how to do it pragramatically with your web requests.
I managed to track the first request to sign out. And here is the information from analyzer:
(Request-Line):GET /mail/?logout&hl=en HTTP/1.1
Host:mail.google.com
Proceed on in this manner. And don't forget about cookies. I spent a tone of time working with cookies when I have dealt with this sort of tasks.
If my solution will help you please accept it and vote for it.