I donβt see where you indicate that you want to publish JSON, so I'm sure that you are sending the URL encoding of the form, which goes like this, according to the AFHTTPClient documentation:
If a couple of query lines has an NSArray for its value, each member of the array will be represented in the format field[]=value1&field[]=value2 . Otherwise, the pair will be formatted as "field = value". String representations of both keys and values ββare output using the -description method. Does the query string string not include? character used to delimit the request component.
If your server really expects you to publish JSON, add it to the second line to tell AFNetworking that:
// AFNetworking 1.0 // httpClient is a subclass of AFHTTPClient httpClient.parameterEncoding = AFJSONParameterEncoding; // AFNetworking 2.0 // httpClient is a subclass of AFHTTPRequestOperationManager or AFHTTPSessionManager httpClient.requestSerializer = AFJSONRequestSerializer;
Then you remove your NSJSONSerialization call and just put objectsInCart in the parameters dictionary.
Note: this is normal for subclassing AFHTTPRequestOperationManager or AFHTTPSessionManager (AFNetworking 2.0) or AFHTTPClient (AFNetworking 1.0), and put this type of configuration in your initWithBaseURL: . (You probably do not want to deploy a new client for each request.)
source share