AFNetworking posts JSON arrays as multiple single-entry dictionaries

前端 未结 4 1603
予麋鹿
予麋鹿 2020-12-19 13:26

I\'m having a similar issue to the one discussed here.

I\'m attempting to post JSON to a server.

Here\'s the Objective-C code that should work, but

4条回答
  •  清歌不尽
    2020-12-19 14:15

    I'm using POST, so query strings are not involved. But maybe the limitation exists with POST data as well?

    The limitation is not on POST, it's URL form encoding. I go on to say that you should encode as JSON, which you can do with the following configuration change to your manager:

    manager.requestSerializer = [AFJSONRequestSerializer serializer];.

    Also, unless you're actually constructing a multi-part request, don't use the constructingBodyWithBlock version of that method.

提交回复
热议问题