{"id":532,"date":"2014-09-02T15:08:03","date_gmt":"2014-09-02T07:08:03","guid":{"rendered":"http:\/\/www.yusian.com\/blog\/?p=532"},"modified":"2016-07-15T14:16:34","modified_gmt":"2016-07-15T06:16:34","slug":"afnetworking%e6%97%a0%e6%b3%95%e5%8f%91%e9%80%81web%e8%af%b7%e6%b1%82code-1016","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/analysis\/2014\/09\/02\/150803532.html","title":{"rendered":"AFNetworking\u65e0\u6cd5\u53d1\u9001Web\u8bf7\u6c42Code = -1016"},"content":{"rendered":"<p><strong>2014-09-02 15:02:52.601 Crayfish[7211:60b] Error Domain=com.alamofire.error.serialization.response Code=-1016 &#8220;Request failed: unacceptable content-type: text\/html&#8221;<\/strong><\/p>\n<p>\u4ece\u4ee5\u4e0a\u7684\u9519\u8bef\u63d0\u793a\u6765\u770b\u95ee\u9898\u5df2\u7ecf\u660e\u4e86\u4e86\uff0c<strong>unacceptable content-type: text\/html<\/strong>&#8220;\u65e0\u6cd5\u63a5\u53d7\u7684\u5185\u5bb9\u7c7b\u578b\u201ctext\/html\u201d<br \/>\n\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\n\u627e\u5230AFURLResponseSerialization.m\u6587\u4ef6\u4e2d\u7684init\u65b9\u6cd5<\/p>\n<pre lang=\"objc\" line=\"1\">- (instancetype)init {\n    self = [super init];\n    if (!self) {\n        return nil;\n    }\n\n    self.acceptableContentTypes = [NSSet setWithObjects:@\"application\/json\", @\"text\/json\", @\"text\/javascript\", nil];\n\n    return self;\n}<\/pre>\n<p>self.acceptableContentTypes = [NSSet setWithObjects:@&#8221;application\/json&#8221;, @&#8221;text\/json&#8221;, @&#8221;text\/javascript&#8221;, nil];<br \/>\n\u5728\u8fd9\u884c\u4ee3\u7801\u4e2d\u589e\u52a0text\/html\u7c7b\u578b<\/p>\n<p>self.acceptableContentTypes = [NSSet setWithObjects:@&#8221;application\/json&#8221;, @&#8221;text\/json&#8221;, @&#8221;text\/javascript&#8221;, <strong>@&#8221;text\/html&#8221;<\/strong>, nil];<\/p>\n<p>OK\uff0c\u641e\u5b9a\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2014-09-02 15:02:52.601 Crayfish[7211:60b] Error Domain=com.alamofire.error.serialization.response Code=-1016 &#8220;Request failed: unacceptable content-type: text\/html&#8221; \u4ece\u4ee5\u4e0a\u7684\u9519\u8bef\u63d0\u793a\u6765\u770b\u95ee\u9898\u5df2\u7ecf\u660e\u4e86\u4e86\uff0cunacceptable content-type: text\/html&#8220;\u65e0\u6cd5\u63a5\u53d7\u7684\u5185\u5bb9\u7c7b\u578b\u201ctext\/html\u201d \u89e3\u51b3\u529e\u6cd5\uff1a \u627e\u5230AFURLResponseSerialization.m\u6587\u4ef6\u4e2d\u7684init\u65b9\u6cd5 &#8211; (instancetype)init { self = [super init]; if (!self) { return nil; } self.acceptableContentTypes = [NSSet setWithObjects:@&#8221;application\/json&#8221;, @&#8221;text\/json&#8221;, @&#8221;text\/javascript&#8221;, nil]; return self; } self.acceptableContentTypes = [NSSet setWithObjects:@&#8221;application\/json&#8221;, @&#8221;text\/json&#8221;, @&#8221;text\/javascript&#8221;, nil]; \u5728\u8fd9\u884c\u4ee3\u7801\u4e2d\u589e\u52a0text\/html\u7c7b\u578b self.acceptableContentTypes = [NSSet setWithObjects:@&#8221;application\/json&#8221;, @&#8221;text\/json&#8221;, @&#8221;text\/javascript&#8221;, @&#8221;text\/html&#8221;, nil]; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[17,18],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-analysis","tag-skill","tag-network"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}