CRAlpha / CRAlpha/react-native-wkwebview

HTTP POST request body is empty

Open
#52 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
637
Forks
263
PR merge metrics
No merged PRs in 30d

Description

Hi,

First off, thanks for all the hard work. This module looks really promising!

Now over to the issue; for some reason it does not seem to work properly with HTTP POST requests. More specifically the POST-body seems to be missing from the request.

Basically what I've done is drop this module in place of the old WebView. The only change in my code is doing `import WKWebView from 'react-native-wkwebview-reborn';` and replacing my old `WebView` with `WKWebView`.

Setting the following as `source` on the old WebView works;
```javascript
source={
method: 'POST',
body: `samlResponse=${encodeURIComponent(saml)}`,
uri: authUrl
}
```

But it fails on this WKWebView module.

What I'm trying to do is POST an authentication SAML to a certain URL. Just setting a breakpoint in the code I can see that the properties are set on source:
![image](https://cloud.githubusercontent.com/assets/4932625/24284947/12eca058-106e-11e7-8bcb-e3c87b258c40.png)

But for some reason, the `samlResponse` is empty on the receiving endpoint. I've also checked with Charles Proxy that the POST-body is empty.

Seems like this might be a general problem with `WKWebView` though:
* [look here](https://bugs.webkit.org/show_bug.cgi?id=167131)
* [and here](https://forums.developer.apple.com/thread/18952)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.