search

Home  >  Q&A  >  body text

ios - AFNetWorking 做网络请求的一个问题。

manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];

这段代码是什么意思?

伊谢尔伦伊谢尔伦2772 days ago342

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-18 09:57:46

    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];
    

    reply
    0
  • Cancelreply