From 6587f1edf177096cf9686153f32bad5c40cf83c0 Mon Sep 17 00:00:00 2001 From: Daniel Ignat Date: Fri, 7 Sep 2018 13:30:42 +0200 Subject: [PATCH] If source.method is "post", use HTTP POST method The React Native Web View takes a method option to determine if HTTP GET or HTTP POST should be used. For iPhone this is not case sensitive, meaning that `method: "post"` is allowed. For Android "post" is not understood and therefore the request will be using HTTP GET. I suggest we ignore case for the method, or throw an Exception. --- .../com/facebook/react/views/webview/ReactWebViewManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java index 6e55b80f8c3e5a..32af42b587e786 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java @@ -525,7 +525,7 @@ public void setSource(WebView view, @Nullable ReadableMap source) { } if (source.hasKey("method")) { String method = source.getString("method"); - if (method.equals(HTTP_METHOD_POST)) { + if (method.equalsIgnoreCase(HTTP_METHOD_POST)) { byte[] postData = null; if (source.hasKey("body")) { String body = source.getString("body");