Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Post Timeline

added 94 characters in body; edited tags
Source Link

following code

var webView: WKWebView!
override func loadView() {
 super.loadView()
 self.webView = WKWebView(frame: .zero)
 view = webView
}
override func viewDidLoad() {
 super.viewDidLoad()
 
 var request = URLRequest(url: URL(string: "https://hosts")!)
 request.httpMethod = "POST"
 let bodyData = "data1=postData"
 request.httpBody = bodyData.data(using: .utf8)!
 self.webView.load(request)
}

I was able to get the POST parameters are passed inparameter on Web site loaded on iOS 11.2, but POST parameters arecould not passed inget it on iOS 11.3

Why did not get it on iOS 11.3? Was the specification changed?

Anyone pleaseI want anyone to tell me the workaround. Please give me the answer.

following code

var webView: WKWebView!
override func loadView() {
 super.loadView()
 self.webView = WKWebView(frame: .zero)
 view = webView
}
override func viewDidLoad() {
 super.viewDidLoad()
 
 var request = URLRequest(url: URL(string: "https://hosts")!)
 request.httpMethod = "POST"
 let bodyData = "data1=postData"
 request.httpBody = bodyData.data(using: .utf8)!
 self.webView.load(request)
}

POST parameters are passed in iOS 11.2, but POST parameters are not passed in iOS 11.3.

Anyone please give me the answer.

following code

var webView: WKWebView!
override func loadView() {
 super.loadView()
 self.webView = WKWebView(frame: .zero)
 view = webView
}
override func viewDidLoad() {
 super.viewDidLoad()
 
 var request = URLRequest(url: URL(string: "https://hosts")!)
 request.httpMethod = "POST"
 let bodyData = "data1=postData"
 request.httpBody = bodyData.data(using: .utf8)!
 self.webView.load(request)
}

I was able to get the POST parameter on Web site loaded on iOS 11.2, but could not get it on iOS 11.3

Why did not get it on iOS 11.3? Was the specification changed?

I want anyone to tell me the workaround. Please give me the answer.

Source Link

Can't set httpBody on WKWebView POST request in iOS11.3

following code

var webView: WKWebView!
override func loadView() {
 super.loadView()
 self.webView = WKWebView(frame: .zero)
 view = webView
}
override func viewDidLoad() {
 super.viewDidLoad()
 
 var request = URLRequest(url: URL(string: "https://hosts")!)
 request.httpMethod = "POST"
 let bodyData = "data1=postData"
 request.httpBody = bodyData.data(using: .utf8)!
 self.webView.load(request)
}

POST parameters are passed in iOS 11.2, but POST parameters are not passed in iOS 11.3.

Anyone please give me the answer.

default

AltStyle によって変換されたページ (->オリジナル) /