0

I've been trying to send some data in React Native with HTTP fetch, but I can't send fairly large chunks of data. It stops sending from about 2200 characters of text.

export const postServerData = (myURL, myJSONData, callback) => {
  fetch(myURL, {
    method: 'POST', // or 'PUT'
    headers: {
      'Content-Type': 'application/json',
  },
  body: JSON.stringify(myJSONData),
})
  .then(response => response.json())
  .then(myReturnedData => {
      callback(myReturnedData);
  })
  .catch(error => {
  });
};  

From a few articles, data cap is quite fairly large :

Can HTTP POST be limitless?

The maximum POST request body size is configured on the HTTP server and typically ranges from 1MB to 2GB

How can I send larger chunks in React Native (Android)?

starball
  • 20,030
  • 7
  • 43
  • 238
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142

0 Answers0