gpt4 book ai didi

image - FBRequest : Why aren't non-text mime type responses allowed?(iOS SDK)

转载 作者:行者123 更新时间:2023-12-04 18:11:32 25 4
gpt4 key购买 nike

假设使用Facebook iOS SDK,我对用户的个人资料图片执行了图形请求:

[FBRequest requestForGraphPath:@"me/picture"]

我会收到此错误:
Response is a non-text MIME type; endpoints that return images and other binary data should be fetched using `NSURLRequest` and `NSURLConnection`.

这背后的原因是什么?手动编写请求只花了一分钟,但是为什么Facebook iOS SDK中没有包含此常见任务,或者我错过了什么呢?

浏览Github上的Facebook iOS SDK repo ,我们在 FBRequestConnection.m中看到了这一点:
if (!error && [response.MIMEType hasPrefix:@"image"]) {
error = [self errorWithCode:FBErrorNonTextMimeTypeReturned
statusCode:0
parsedJSONResponse:nil
innerError:nil
message:@"Response is a non-text MIME type; endpoints that return images and other "
@"binary data should be fetched using NSURLRequest and NSURLConnection"];
}

如果我正确地理解了这一点, FBRequestConnection会得到我想要的响应(即个人资料图片),然后告诉我我不能拥有它。太逗了为什么首先提出请求?

对此有何评论?

最佳答案

大图
me?fields=picture.type(large)
请参阅Facebook Graph API Change: Picture type (size) no longer working?

关于image - FBRequest : Why aren't non-text mime type responses allowed?(iOS SDK),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12966647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com