title: Getting a 401 "unauthorized" when calling Google Docs API using SignPost from Android
body: <p>I am able to call GET successfully and get lists of docs and spreadsheets from Google Documents List API and Spreadsheets API using OAuth with SignPost in Android. However, I have spent hours trying to make a successful POST call and keep getting a 401. I Would appreciate any hints or comments. Thanks</p>
  
  <p>Here is the code:</p>
  
  <pre><code>//I get the secret and token successfully  
  CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(C.OAuth.CONSUMER_KEY,         C.OAuth.CONSUMER_SECRET);
  consumer.setMessageSigner(new HmacSha1MessageSigner());  
  consumer.setTokenWithSecret(token, secret);
  
  //Set the Docs Uri  
  String url = consumer.sign("https://docs.google.com/feeds/default/private/full"); 
  
  HttpPost post = new HttpPost(url);
  
  //Add headers          
  post.addHeader("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");  
  post.addHeader("Host","docs.google.com");  
  post.addHeader("Accept","*/*");  
  post.addHeader("Content-Type","application/atom+xml");  
  post.addHeader("GData-Version","3.0");  
  
  //Create and add post body        
  String reqBody="&lt;?xml version='1.0' encoding='UTF-8'?&gt;"+
  "&lt;entry xmlns=\"http://www.w3.org/2005/Atom\"&gt;"+
  "&lt;category scheme=\"http://schemas.google.com/g/2005#kind\" term=\"http://schemas.google.com/docs/2007#document\"/&gt;"+
  "&lt;title&gt;new document&lt;/title&gt;"+
  "&lt;/entry&gt;";        
  
  StringEntity se = new StringEntity(reqBody,"UTF-8");  
  post.setEntity(se);  
  
  //Create and execute the Client  
  HttpClient client = new DefaultHttpClient();  
  HttpResponse response =  client.execute(post);
  </code></pre>
  
  <p>-->401 Unauthorized</p>