From a98755c00a851765074e4ed866151232e03f931f Mon Sep 17 00:00:00 2001 From: huangzuizui Date: Sun, 24 May 2020 01:06:10 +0800 Subject: [PATCH] fix 'Network Error' in react native android (#1487) There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. Co-authored-by: Jay --- lib/adapters/xhr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 4cda89a..bf90efd 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -169,7 +169,7 @@ module.exports = function xhrAdapter(config) { }); } - if (requestData === undefined) { + if (!requestData) { requestData = null; }