From 6e7ffff4a578d5eeb399df917a402f9226e83447 Mon Sep 17 00:00:00 2001 From: Daniel Ignat Date: Fri, 7 Sep 2018 07:49:55 -0700 Subject: [PATCH] If source.method is "post", use HTTP POST method (#21010) Summary: 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. Pull Request resolved: https://github.com/facebook/react-native/pull/21010 Differential Revision: D9700895 Pulled By: hramos fbshipit-source-id: 3fa904e7946dd40958cb44f9a234ee66cb68fab2 --- .../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 6e55b80f8c3..32af42b587e 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 class ReactWebViewManager extends SimpleViewManager { } 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");