大佬教程收集整理的这篇文章主要介绍了ios – AFNetworking 2.0 POST问题|替换已弃用的multipartFormRequestWithMethod:path:参数,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
问题如下
/Api/ApiClient.m::: error: unexpected interface name 'NSData': expected expression NSData* callerData = [@"http://nikyotis.xyz" dataUsingEncoding:NSUTF8StringEncoding]; ^ /Api/ApiClient.m::: error: use of undeclared identifier 'callerData' NSData* callerData = [@"http://nikyotis.xyz" dataUsingEncoding:NSUTF8StringEncoding];
在上面例子的第280行
下面的原始AFNetwork-1.0代码
我尝试通过用// 1替换例程来迁移到AFNetwork-2.0
或// 2
没有任何成功
@H_675_32@ @H_618_33@解决方法尝试类似的东西:
NSMutableURLrequest* request = [ [ApiManager sharedManager] POST:@"/v1/exec" parameters:nil construcTingBodyWithBlock:^(id<AFMultipartFormData> formData) { // Code to form the body of the form is here //NSData* callerData = [[NSData alloc] init]; NSData* callerData = [@"http://nikyotis.xyz" dataUsingEncoding:NSUTF8StringEncoding]; [formData appendPartWithFormData:callerData name:@"caller"]; [formData appendPartWithFileData:fontData name:@"front" filename:@"front" mimeType:@"application/octet-stream"]; [formData appendPartWithFileData:sideData name:@"side" filename:@"side" mimeType:@"application/octet-stream"]; } success:^(AFhttprequestOperation *operation,id responSEObject) { // Operation success code goes here } failure:^(AFhttprequestOperation *operation,NSError *error) { // Operation Failed code goes here } ];
对任何格式问题道歉 – 有降价麻烦.
@H_675_32@ @H_675_32@以上是大佬教程为你收集整理的ios – AFNetworking 2.0 POST问题|替换已弃用的multipartFormRequestWithMethod:path:参数全部内容,希望文章能够帮你解决ios – AFNetworking 2.0 POST问题|替换已弃用的multipartFormRequestWithMethod:path:参数所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。