#Can I not fetch from an API that returns an array and make it JSON?

18 messages · Page 1 of 1 (latest)

tranquil hull
lofty nymph
#

well, then you are doing something wrong

tranquil hull
#

yeah figured that much out

lofty nymph
#

because that is valid JSON

#

seeing that you include no code i'm not too sure what else you expect as an answer

tranquil hull
#

oh yeah right one sec

#

doesn't log anything bc the error throws before that

#

the link isn't wrong either thats why im so confused

smoky falcon
#

you need to allow unici to follow redirects. https://reddit.com/r/dankmemes/random.json redirects you to a random post, but unici doesnt follow redirects by default

tranquil hull
#

OH

#

thank you

#

how do i do that

#

😭 sorry

smoky falcon
#

request("...", { maxRedirections: 1 }) should be ok

tranquil hull
#

ty

smoky falcon
#

maybe you need more than 1, gotta test it

tranquil hull
#

i mean it only redirects once right