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

不想你离开。 提交于 2019-12-19 04:04:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/24682722/how-to-set-http-header-in-uiwebview-if-loading-view-with-loadhtmlstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!