Skip to content
Back

Unexpected HTTP code Response

  • 0
  • React Native
  • Storage
mithun_hr
24 Nov, 2024, 13:19

Can some please help with to load image from a bucket for a specific user for react native app (expo).

I have attached the code and the permissions for the bucket but facing this error:

(NOBRIDGE) LOG Started loading image 67431e890029341b2e32 (NOBRIDGE) LOG Started loading image 674311b7293ac8626c60 (NOBRIDGE) ERROR Error loading image 67431e890029341b2e32: {"error": "Unexpected HTTP code Response{protocol=h2, code=401, message=, url=my-endpoint/v1/storage/buckets/674311a40039c9d6ce79/files/67431e890029341b2e32/view?project=673dec23001013bd72c9}", "target": 2330} (NOBRIDGE) LOG Failed URL: my-endpoint/v1/storage/buckets/674311a40039c9d6ce79/files/67431e890029341b2e32/view?project=673dec23001013bd72c9 (NOBRIDGE) LOG Headers: {"Cookie": "a_session_673dec23001013bd72c9=67431fc7ebc5c3949acf", "X-Appwrite-Project": "673dec23001013bd72c9", "X-Appwrite-Response-Format": "1.0.0", "X-Appwrite-Session": "67431fc7ebc5c3949acf"} (NOBRIDGE) ERROR Error loading image 674311b7293ac8626c60: {"error": "Unexpected HTTP code Response{protocol=h2, code=401, message=, url=my-endpoint/v1/storage/buckets/674311a40039c9d6ce79/files/674311b7293ac8626c60/view?project=673dec23001013bd72c9}", "target": 2352} (NOBRIDGE) LOG Failed URL: my-endpoint/v1/storage/buckets/674311a40039c9d6ce79/files/674311b7293ac8626c60/view?project=673dec23001013bd72c9 (NOBRIDGE) LOG Headers: {"Cookie": "a_session_673dec23001013bd72c9=67431fc7ebc5c3949acf", "X-Appwrite-Project": "673dec23001013bd72c9", "X-Appwrite-Response-Format": "1.0.0", "X-Appwrite-Session": "67431fc7ebc5c3949acf"}

TL;DR
Developers are getting an Unexpected HTTP code Response (401) when trying to load images from a bucket for a user in a React Native app using Expo. The error message mentions authentication issues. Solution: Check the permissions for the bucket and ensure that the correct authentication credentials are being used to access the images.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more