title: http POST request response with "status": 200 but with an empty object
body: <p>I am trying to use an API with HTTP POST request and It seems to work but when I get the response it's empty. </p>
  
  <p>The API should receive <code>base64</code> encoded image inside the body. </p>
  
  <p>The argument  <code>imageToRead</code> coming from a promise returned with the <code>Camera</code> component from <code>react-native-camera</code>. I'm not sure maybe the problem there? </p>
  
  <p>This is the content:
  <code>imageToRead = "/var/mobile/Containers/Data/Application/01B81FC9-B171-11GB-9B48-9D06F89B175A/Documents/3A997ACD-D63C-41BD-9041-FDB834A0672A.jpg"</code></p>
  
  <p>This API can also receive <code>formData</code> files and that how I tested it with and it went great in Node environment. But because my application is a native iOS application, I had to use other tools (like React Native) and can not use the same ones. </p>
  
  <p><strong>Code to test the API in Node:</strong></p>
  
  <pre><code>var formData = {image: fs.createReadStream('/Users/Desktop/APITest/img/testOCR8.jpg')};
  request.post({
  url:'${url}', 
  formData: formData},
  (err, httpResponse, body) =&gt; {
      if (err) {
          return console.error('upload failed:', err);
      }
      console.log(body);
  
  });
  </code></pre>
  
  <p>You can see I use <code>fs.createReadStream</code> from the <code>fs</code> module to create stream of the file and then use it inside the request body. 
  I couldn't replicate the same thing using React Native (if you have a solution so I could do it with React Native it would be even better!!) </p>
  
  <p>So I tried deferent way and tried to encode the file I got from the <code>camera.capture()</code> method that come with <code>react-native-camera</code> to <code>base64</code> and to place it inside the body but the response I got is empty without any errors, just an empty object.  </p>
  
  <p><strong>Code with React Native:</strong></p>
  
  <pre><code>recognise = (imageToRead) =&gt; {
      RNFetchBlob.fs.readFile(imageToRead , 'base64')
        .then((data) =&gt; {
          fetch('${url}',{
          method: "POST",
          headers: {
             'Accept': 'application/json',
             'Content-Type': 'application/json'
          },
          body: data // the body contain the encoded image
          })
        .then((res) =&gt; {  // promise returned with the response from the API
          console.log(`i am the base64Image: ${data}`)
          console.log('i am response', res)
        })  
        .catch((errInFetch) =&gt; { // catch any error in the API
          console.log('i am error:', errInFetch)
        })
      })
      .catch((err) =&gt; {
        console.log(err);
      })
    }
  </code></pre>
  
  <p><strong>Response:</strong></p>
  
  <pre><code>{ type: 'default',
    status: 200,
    ok: true,
    statusText: undefined,
    headers: 
     { map: 
        { server: [ 'nginx/1.10.3' ],
          'content-type': [ 'application/json; charset="utf-8"' ],
          'access-control-allow-origin': [ '*' ],
          date: [ 'Thu, 10 May 2018 10:17:48 GMT' ],
          'access-control-allow-headers': [ 'x-requested-with' ],
          'content-encoding': [ 'gzip' ],
          'content-length': [ '237' ],
          connection: [ 'keep-alive' ] } },
    url: 'https://api.openalpr.com/v2/recognize_bytes?secret_key=key&amp;country=eu',
    _bodyInit: 
     { _data: 
        { size: 371,
          blobId: '5080ACA4-5D13-469C-B755-96B06A161FC6',
          type: 'application/json',
          offset: 0,
          name: 'recognize_bytes' } },
    _bodyBlob: 
     { _data: 
        { size: 371,
          blobId: '5080ACA4-5D13-469C-B755-96B06A161FC6',
          type: 'application/json',
          offset: 0,
          name: 'recognize_bytes' } } }
  </code></pre>
  
  <p>I hope someone can help with this. I have struggle with it for so long time. </p>