+ 3

fetch imgbb API

I am trying to use the imgbb API. It worked with an ajax method i found online but I cannot get ut to work with fetch. What's wrong with my code? https://code.sololearn.com/WiN9p5782qhN/?ref=app inatruction from imgbb https://api.imgbb.com/

14th Feb 2023, 4:30 PM
Lochard
Lochard - avatar
3 Answers
+ 2
Change jx.status to jx.status_code To see the entire response object just log jx. If you are using sololearn app then log JSON.stringify(jx) IMGBB documentation appears to be lacking.
14th Feb 2023, 6:16 PM
ODLNT
ODLNT - avatar
+ 3
ODLNT Thank you. It is working now. DavX You are right I left it there for others to try. Will change it now.
14th Feb 2023, 10:58 PM
Lochard
Lochard - avatar
+ 1

plus always a good idea to remove credentials (like your api key) 👍
14th Feb 2023, 6:22 PM
DavX
DavX - avatar