Twitter OAuth: 401 Unauthorized


#1

I am trying to use OAuth for my test application and getting the 401, Here are the details of request and response:

ebug] s.n.w.p.h.HttpURLConnection - sun.net.www.MessageHeader@42857b066 pairs: {POST /oauth/request_token HTTP/1.1: null}{Authorization: OAuth oauth_callback=“http%3A%2F%2Flocalhost%2Ftwitter%2Fcallback”, oauth_consumer_key=“Zr6u9diO9Ek1ysyayrMg”, oauth_version=“1.0”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1344523525”, oauth_nonce="-3164180023256090828", oauth_signature=“smMFabjlCJk5sm2IwuHv506cZlM%3D”}{User-Agent: Java/1.6.0_24}{Host: api.twitter.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2}{Connection: keep-alive}
[debug] s.n.w.p.h.HttpURLConnection - sun.net.www.MessageHeader@216b09cd18 pairs: {null: HTTP/1.1 401 Unauthorized}{Date: Thu, 09 Aug 2012 14:45:26 GMT}{Status: 401 Unauthorized}{Content-Length: 178}{X-MID: cc89328529d926f6466e2788c06b5ae5782f16dc}{Pragma: no-cache}{Expires: Tue, 31 Mar 1981 05:00:00 GMT}{Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0}{Last-Modified: Thu, 09 Aug 2012 14:45:26 GMT}{X-Frame-Options: SAMEORIGIN}{WWW-Authenticate: OAuth realm=“https://api.twitter.com”}{Content-Type: text/html; charset=utf-8}{X-Transaction: b04a99d4b1b384b7}{Set-Cookie: k=10.34.110.106.1344523526714376; path=/; expires=Thu, 16-Aug-12 14:45:26 GMT; domain=.twitter.com}{Set-Cookie: guest_id=v1%3A134452352672595534; domain=.twitter.com; path=/; expires=Sun, 10-Aug-2014 02:45:26 GMT}{Set-Cookie: _twitter_sess=BAh7CCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7ADoPY3JlYXRlZF9hdGwrCEbi2As5AToHaWQiJTY1%250AZjVkYjE0N2YwOTRiNTliZGIxYTY1NzUxOGE3OWU0–736696c0b90c9087f02d778779d6231ace0b788a; domain=.twitter.com; path=/; HttpOnly}{Vary: Accept-Encoding}{Server: tfe}