title: iOS: failed socket-flow with Spring Boot
body: <p><strong>Background</strong><br>
  I want to send a base64 string from an iOS app to a Spring boot backend using the Alamofire lib.</p>
  
  <p><strong>Problem</strong><br>
  It fails with this error:</p>
  
  <pre><code>2017-08-31 10:22:49.547259+0200 Epic[851:367066] [] 
  nw_endpoint_flow_prepare_output_frames [6.1 46.30.215.94:80 ready 
  socket-flow (satisfied)] Failed to use 1 frames, marking as failed
  2017-08-31 10:22:49.549173+0200 Epic[851:367066] [] 
  nw_endpoint_handler_add_write_request [6.1 46.30.215.94:80 failed 
  socket-flow (satisfied)] cannot accept write requests
  2017-08-31 10:22:49.552773+0200 Epic[851:367069] [] 
  tcp_connection_write_eof_block_invoke Write close callback received 
  error: [22] Invalid argument
  </code></pre>
  
  <p>This problem occured when I changed endpoint from my local development environment to Heroko. (<a href="http://heroku.com" rel="nofollow noreferrer">http://heroku.com</a>).</p>
  
  <p>I can send smaller images without problem (100x100) but not (600x600).</p>
  
  <p><strong>I have tried:</strong><br>
  -To add a http header "Content-Length" and length of the json body.<br>
  -To change from sending a json body to URL params.  </p>
  
  <p>Any suggestions? Can I configure heroku spring boot to accept bigger http requests of data or is it a setting a need to do in the app?  </p>
  
  <p>My code:  </p>
  
  <pre><code>func createImage(_ image: UIImage, success: @escaping (String)-&gt;(), failed: @escaping (Void)-&gt;(Void)){
      let base64 = image.getImageAsBase64()
      Alamofire.request(self.url, method: .put, parameters: ["image" : base64], headers: self.headers)
          .responseString(completionHandler: {response in
              switch(response.result) {
              case .success(let response):
                  success(response)
                  break;
              case .failure(let error):
                  print(error)
                  failed()
                  break;
              }
          })
  }
  </code></pre>