-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,文件上传问题打扰了 #33
Comments
request.requestSerializer = ZBHTTPRequestSerializer 试试 @Samuel-Xi |
您好,这样设置了request.requestSerializer = ZBHTTPRequestSerializer,还是报相同的错误Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo={NSLocalizedDescription=Request failed: bad request (400) |
methodType=ZBMethodTypeUpload |
这样写可以请求成功: |
看着像是ContentTypes文件类型的问题 ,我看你上传的是MP3,默认我已经添加了multipart/form-data,应该是可以兼容MP3的,你可以增加一个audio/mpeg 类型试试,是否能消除警告。如果只是警告不影响使用,也可以不用处理 |
好的👌,谢谢,我试一下 |
您好,像这种带参数的文件上传该怎么处理,我使用methodType=ZBMethodTypeUpload,或是methodType=ZBMethodTypePOST都报error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo={NSLocalizedDescription=Request failed: bad request (400) 错误,request我是这样配置的:
request.methodType=ZBMethodTypePOST;
request.requestSerializer = ZBJSONRequestSerializer;
request.responseSerializer = ZBJSONResponseSerializer;
request.parameters = @{@"submission_id":@"10"};
[request addFormDataWithName:@"file" fileURL:outFileUrl];
不知道是啥问题,帮忙看看,感激不尽🤝🤝
The text was updated successfully, but these errors were encountered: