虽然我知道Expo提供了文件系统。downloadAsync方法用于保存图像,我的端点(与示例不同)需要POST请求,这意味着downloadAsync不适合。
当我提出发帖请求时,我也有同样的行为。
-
我已经将URL直接添加到图像元素中,加载效果很好。
-
我尝试使用text()和json()只是为了查看结果是否发生了变化,在这两种情况下,响应都是空的。
-
我曾尝试使用API测试仪,例如:
https://apitester.com/
以下内容可以在我的
snack
这是我的请求:
fetch('https://i.imgur.com/c9waLgY.jpg')
.then(result => {
console.log(result)
return result.blob()
})
.then(result => {
console.log('blob', result);
})
.catch(error => console.log(error));
content-type:"image/jpeg"
access-control-allow-methods:"GET, OPTIONS"
access-control-allow-origin:"*"
cache-control:"public, max-age=31536000"
x-cache-hits:"1, 1"
date:"Wed, 23 Jan 2019 21:10:36 GMT"
accept-ranges:"bytes"
etag:""bcb343578e3ea0d0d824f62e66d22bf0""
server:"cat factory 1.0"
age:"15302"
last-modified:"Wed, 23 Jan 2019 16:00:45 GMT"
x-timer:"S1548277836.140914,VS0,VE2"
content-length:"192289"
x-served-by:"cache-iad2133-IAD, cache-sea1051-SEA"
x-cache:"HIT, HIT"
以及以下blob:
blobId:"a910e21b-80ba-44da-b6fa-20194b152538"
offset:0
size:0
type:""
lastModified:1548278321298