查看响应的http header

发布于 2024-10-09 23:50:03 字数 95 浏览 0 评论 0原文

使用 UIWebViews 时,有没有一种方法可以捕获请求(所有 GET 请求 - 也适用于页面的内容/图像等),以便我可以检查请求/响应标头(无需解析为wireshark)?

When working with UIWebViews, is there a way to capture a request (all GET requests - also for the page's content/images etc.) on the way so that I can examine the request/response headers (without resolving to wireshark)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你爱我像她 2024-10-16 23:50:03

您可以通过下面的函数设置webview的delegate并捕获请求。

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

然后检查请求对象内的请求标头。

You can set the delegate of the webview and capture the request by function below.

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

Then exam the request header inside the request object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文