title: Exception in HostFunction: Malformed calls from JS when using fetch to upload image on React Native
body: <p>I'm trying to upload an image to a server using fetch and it works fine on Android but on iOS I get an error, the upload actually works but this error always shows.</p>
  <pre class="lang-js prettyprint-override"><code>export const uploadImage = async (image: Response, organisation: string, tokenData: any) =&gt; {
    if (image.data) {
      const JWT = pathOr('', ['getFileAccessToken', 'AccessToken'], tokenData);
      // image.filename doesn't exist on android
      const filename = Platform.OS === 'ios' ? image.filename : image.path.split('/').pop();
      const buffer = Buffer.from(image.data, 'base64');
      const response = await fetch(`${config.API_ENDPOINT}/files/${filename}`, {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${JWT}`,
          'Content-Type': image.mime,
          'CP-Org-Name': organisation,
        },
        body: buffer,
      });
      return response.json();
    }
  };
  </code></pre>