ios - AFNetWorking 做网络请求的一个问题。
伊谢尔伦
伊谢尔伦 2017-04-18 09:55:46
0
1
343
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];

这段代码是什么意思?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
大家讲道理

manager's responseSerializer attribute. It only sets some fixed parsing formats. It does not include data formats such as text/html. The bottom layer of AFNetworking’s parsing format does not have data formats such as text/html:

manager.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];

In order to avoid errors in network data parsing, add the text/html type to the receivable content types

manager.responseSerializer.acceptableContentTypes= [NSSetsetWithObjects:@"text/html", nil];
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template