Afnetworking 2.0-1016 Error Resolution

Source: Internet
Author: User

Afnetworking 2.0 has been available for a long time. The new version was rewritten again and made a lot of changes. It is also very convenient to use. But there are some problems with using it at some point. For example, when requesting the background data, the JSON data should be returned, but the printing gets the wrong information hint:request failed:unacceptable content-type:text/html ErrorCode =- 1016.

Most of the answers on the Web are:

/// /// practices before AFN2.0 [Afjsonrequestoperation addacceptablecontenttypes:[nsset Setwithobject:@ "text/html" ]]; /// ///

Afnetworking 2.0 How to modify, in fact, can be inspired by 1.0, but the position has changed.

// // /// The practice for AFN2.0 in afurlresponseserialization.m modify the following, add text/html can. self.acceptablecontenttypes = [Nsset setwithobjects:@ "application/json"@ "  Text/json"@"text/javascript"@"text/ HTML", nil]; ////

Afnetworking 2.0-1016 Error Resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.