title: create document in cloudant using post request
body: <p>I am trying to create new document in cloudant database using post request i have attached my android code, please let me know what should be done to create document and insert two values inside the document, i have attached the code for which i am getting 403 as response.</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Base64;
  import android.util.Log;
  import android.view.View;
  
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonObjectRequest;
  import com.android.volley.toolbox.Volley;
  
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.util.HashMap;
  import java.util.Map;
  
  
  public class MainActivity extends AppCompatActivity {
  private String url = "https:bluemix.cloudant.com/databasename/documentname";
  
  private String REV;
  
  enter code here
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  public void postreq(View view) {
      HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
      //data in document
      map.put("_id", "123");
      map.put("value1", "1567");
      map.put("value2", "1545");
  
      JsonObjectRequest jar1 = new JsonObjectRequest(Request.Method.POST, url, new JSONObject(map), new Response.Listener&lt;JSONObject&gt;() {
          @Override
          public void onResponse(JSONObject response) {
              try {
                  JSONObject jsonObject = new JSONObject(response.toString());
                  REV = jsonObject.getString("rev");
              } catch (JSONException e) {
              }
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.e("Json Error Res: ", "" + error);
          }
      }){
          @Override
          public Map&lt;String, String&gt; getHeaders() {
              Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
              String credentials = "abcd:XYZ";
                                     //key:Password
              String auth = "Basic "
                      + Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP);
              // Log.e("qqqq", auth);
              params.put("Authorization", auth);
              params.put("Content-Type", "application/json");
              params.put("Accept","application/json");
  
  
              return params;
          }
      };
      RequestQueue req = Volley.newRequestQueue(this);
      req.add(jar1);
  }}
  </code></pre>
  
  <p>Thanks in Advance.</p>