title: Is there a size limit of StringRequest parameters?
body: <p>I want to upload a base64 encoded image and some text to my webserver using Volley StringRequest. </p>
  
  <p>When I directly try to send the base64 string, I get <strong>'Unexpected response code 503'</strong> but when I compress image  then encode it, its working perfectly. The problem is I don't know why am I have to compress my image before sending to server and how much should I compress it or is there any other way to send it without compressing. </p>
  
  <p><strong><code>base64Encode</code></strong> function that I called perfectly working:</p>
  
  <pre><code>public String getStringImage(Bitmap bitmap){
          ByteArrayOutputStream baos=new  ByteArrayOutputStream();
          bitmap.compress(Bitmap.CompressFormat.JPEG,50, baos);
          byte [] b=baos.toByteArray();
          String temp= Base64.encodeToString(b, Base64.DEFAULT);
  
          return temp;
      }
  </code></pre>
  
  <p>The <strong><code>base64Encode</code></strong> function does not work / gives a 503 error :</p>
  
  <pre><code>public String getStringImage(Bitmap bitmap){
          ByteArrayOutputStream baos=new  ByteArrayOutputStream();
          bitmap.compress(Bitmap.CompressFormat.JPEG,100, baos);    
          byte [] b=baos.toByteArray();
          String temp= Base64.encodeToString(b, Base64.DEFAULT);
  
          return temp;
      }
  </code></pre>
  
  <p>The line I want you to consider is: </p>
  
  <p><code>bitmap.compress(Bitmap.CompressFormat.JPEG,50, baos);</code></p>
  
  <p>When I change this compression parameter to 100 its throwing error.</p>
  
  <p>I thought there might be a size limit when making POST REQUEST or there might be a size limit of Volley <code>StringRequest</code> or there might be no size limits at all.</p>
  
  <p>&lt;--- UPDATE --->                                                                If the problem is really a size limit, then how do I calculate what the JPEG size will be after compression with <code>bitmap.compress (Bitmap.CompressFormat.JPEG, 50, baos)</code> without actually compressing it? Or how do I know if I can compress my image enough when I use 15 as the compression parameter?</p>