Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set http header in uiwebview if loading view with loadHTMLString

I have a UIWebView that i am loading using loadHTMLString and i need to set cookies on the request header. I know how to do this using loadRequest but not loading the webview with loadHTMLString I don't have the request object. Has anyone done anything like this?

like image 689
Deprecated Darren Avatar asked Feb 07 '26 14:02

Deprecated Darren


1 Answers

There will not be any difference between loading web view from loadRequest vs loadHTMLString method, shouldStartLoadWithRequest method will be called in both cases. You can override your headers there and add header as per your requirements.

like image 90
rishi Avatar answered Feb 09 '26 04:02

rishi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!