新しい AFNetworking 2.0 リリースで簡単なリクエストをしようとしていますが、投稿できないようです。サーバーから「テキスト/jsonまたはアプリケーション/json本体を期待しています」という応答が返されますが、AFNetworkingのGitHubページのドキュメントによると、私はすべてをすべきです。また、コードの最後の行にある operation.request.HTTPBody が常に nil のように見えることにも言及する価値があります。
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *request = @{@"email": self.email.text, @"password": self.password.text};
[manager POST:login parameters:request constructingBodyWithBlock:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"DONE!");
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Failed to log in: %@", operation.responseString);
NSLog(@"Here's the request: %@", operation.request.HTTPBody);
}];