Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于《iOS防DNS污染方案调研---SNI业务场景》的疑问 #19

Open
Nododo opened this issue Apr 2, 2018 · 3 comments
Open
Labels

Comments

@Nododo
Copy link

Nododo commented Apr 2, 2018

Hi, ChenYilong!
在标题包含的文中我读到“使用 NSURLProtocol 拦截 NSURLSession 请求丢失 body”,但我实践中使用NSURLConnection 通过post请求 NSURLProtocol 也会拦截,所以这段话是不是有歧义,或者劳烦解释下。

@FlyingRadish
Copy link

这里没有歧义。NSURLProtocol可以拦截method为POST的请求,但是请求的body被忽略掉了,需要通过其他方式才可以得到

@Nododo
Copy link
Author

Nododo commented Apr 3, 2018

@houxg 你联系上下文:

目中使用 NSURLProtocol 拦截 NSURLSession 请求,下面将支持 Post 请求中面临的一个挑战,以及应对策略介绍一下:

在支持POST请求过程中会遇到丢失

body的 问题,有以下几种解决方法:

方案如下:

换用 NSURLConnection

如果按你的说法,这么写也是有歧义的

@ChenYilong ChenYilong added the Q-A label Jun 11, 2018
@SevenSecondMemoryFish
Copy link

Hi, ChenYilong!
使用NSURLProtocol 拦截post请求,并使用了HTTPBodyStream来获取body信息,现在遇到的情况是HTTPBodyStream也是nil,不知您是如何解决body是nil的问题?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants