WKWebView set custom HTTP headers
To set HTTP headers before the webview navigate to a new page, just cancel the existing request and load a new request:
Problem
This method is not working for POST request, as navigationAction.request.HTTPBody
is always nil
Solution
Use Javascript to send POST request with custom HTTP headers
Call Javascript function from Native call
- (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^ _Nullable)(_Nullable id, NSError * _Nullable error))completionHandler;
References
PreviousRetrieve expiry date of Provisioning Profile Certificate from .ipaNextIAP applicationUsername is nil
Last updated
Was this helpful?