title: Volley JSONException: End of input at character 0 of
body: <p>I've seen others come across this problem, but none of the posts have been able to assist me. I'm attempting to use Volley for my REST call library, and when I'm attempting to use a Put call with a JSON Object as a parameter, I'm getting <code>error with: org.json.JSONException: End of input at character 0 of</code>. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>protected void updateClientDeviceStatus(Activity activity, final int status) {
      JSONObject jsonParams = new JSONObject();
      try {
          jsonParams.put("statusId", String.valueOf(status));
      } catch (JSONException e1) {
          e1.printStackTrace();
      }
      Log.i(LOG_TAG, "json: " + jsonParams.toString());
  
      String url = Constants.API_URL + "client/device/" + getDeviceId();
      // Request a response from the provided URL.
      JsonObjectRequest request = new JsonObjectRequest
              (Request.Method.PUT, url, jsonParams, new Response.Listener&lt;JSONObject&gt;() {
  
                  @Override
                  public void onResponse(JSONObject response) {
                      Log.i(LOG_TAG, "updated client status");
                      Log.i(LOG_TAG, "response: " + response.toString());
                  }
              }, new Response.ErrorListener() {
  
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      Log.i(LOG_TAG, "error with: " + error.getMessage());
                      if (error.networkResponse != null)
                          Log.i(LOG_TAG, "status code: " + error.networkResponse.statusCode);
  
  
                  }
              }) {
  
          @Override
          public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
              Map&lt;String, String&gt;  params = new HashMap&lt;String, String&gt;();
              params.put("User-Agent", getUserAgent());
              params.put("X-BC-API", getKey());
  
              return params;
          }
  
          @Override
          public String getBodyContentType() {
              return "application/json";
          }
      };
  
      request.setRetryPolicy(new DefaultRetryPolicy(20000, 3, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
      MySingleton.getInstance(activity).addToRequestQueue(request);
      }
  }
  </code></pre>
  
  <p>The jsonParams log displays:</p>
  
  <pre><code>json: {"statusId":"1"}
  </code></pre>
  
  <p>Is there another setting that I'm missing? It appears that the request can't parse the JSON Object. I even tried creating a HashMap and then using that to create a JSON Object, but I still get the same result.</p>