当我尝试删除内容项(用户的图片blob项)时,我遇到了一个奇怪的问题,在后端数据库中存储为PNG图片文件。
删除没有错误,但提供“422 Unprocessable Entity”。这是什么意思?在Quickblox管理面板中检查时,内容项的状态似乎正常并准备就绪。
我已通过以下API调用上传了内容:
[QBContent TUploadFile:imageData fileName:@"profile.png" contentType:@"image/png" isPublic:YES delegate:self];
我正在尝试使用以下API调用删除该对象:
[QBContent deleteBlobWithID:blobID delegate:self];
QB日志:
Performing async request:
DELETE http://api.quickblox.com/blobs/91049.xml
headers:{
"QB-SDK" = "iOS 1.8";
"Qb-Token" = b9e3d1cc708c8444070544df8c642ad194509e67;
"QuickBlox-REST-API-Version" = "0.1.1";
}
parameters:
2013-12-12 14:33:52.328 QBTestApp[21095:6b73] Request finished, response:
headers:{
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Length" = 49;
"Content-Type" = "application/xml; charset=utf-8";
Date = "Thu, 12 Dec 2013 13:33:58 GMT";
"QB-Token-ExpirationDate" = "2013-12-12 15:32:22 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.0.15";
Status = "422 Unprocessable Entity";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = 3f235134e5aa0bd012ef78e54cddc164;
"X-Runtime" = "0.039680";
"X-UA-Compatible" = "IE=Edge,chrome=1";
}
body:
error:
<?xml version="1.0" encoding="UTF-8"?>
<errors/>
任何想法我可能在这里做错了吗?先谢谢(再次)! : - )
答案 0 :(得分:2)
您试图删除不存在的blob文件的感觉。请确保在上传和创建过程完成后尝试删除blob文件(调用completedWithResult:结果成功)。
如果我能在代码中看到方法调用TUploadFile:和deleteBlobWithID:的顺序,我可以更快地帮助你。