[英]Can SFSafariViewController load a POST request?
I would like to load a POST request using SFSafariViewController, just like webView.loadRequest(request)
.我想使用 SFSafariViewController 加载 POST 请求,就像 webView.loadRequest webView.loadRequest(request)
。 But I find init(url:entersReaderIfAvailable:)
accepts NSURL only.但我发现init(url:entersReaderIfAvailable:)
只接受 NSURL。 Is it possible to do POST?可以做POST吗?
No, you can't.不,你不能。 It's a browser not a webview.它是浏览器而不是网络视图。
It's possible that you can do the request in advance, but I guess you're doing it to get cookies or something like that..您可能可以提前完成请求,但我猜您这样做是为了获取 cookie 或类似的东西..
So, untested, but you could create a local web page that you load with some parameters, it executes the POST using JavaScript and after its complete it redirects (if required) to some other URL.因此,未经测试,但您可以创建一个带有一些参数的本地网页,它使用 JavaScript 执行 POST,并在完成后重定向(如果需要)到其他一些 URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.