27 Replies
by calling get(key)?
It somehow doesn't show the actual content 🤔 ðŸ˜
Code:
Output:
nope
?
I just tested
get(key, options)
Retrieves the R2ObjectBody for the given key containing object metadata and the object body as a , if the key exists, and null if the key does not exist.
In the event that a precondition specified in options fails, get() returns an with body undefined.
-
body would be stream, so you won't see it after serialization
what
the body is just this:
theres nothing related to that in the output
just read the stream, what can I say
It doesn't get converted by JSON.stringify
what stream
call json() on the object you are getting
and await it
Output:
oh, sorry, I'm stupid, I thought it's json file
call text()
instead
Did it work?
Yes, thanks, json was also invalid, that was probably why the error above lol.
yep, no quotes around cache, i missed it
Thanks!
I literally quoted docs to you, you know:)
I was in this part of docs:
https://developers.cloudflare.com/r2/api/workers/workers-api-usage/
Use R2 from Workers · Cloudflare R2 docs
C3 (create-cloudflare-cli) is a command-line tool designed to help you set up and deploy Workers & Pages applications to Cloudflare as fast as …
There wasn't any .json() part :(
Workers API reference · Cloudflare R2 docs
The in-Worker R2 API is accessed by binding an R2 bucket to a Worker. The Worker you write can expose external access to buckets via a route or …
that's the actual part
The page bellow ðŸ˜
I'm dumb, sorry
lmfao
and all readableStreams probably have this method, I would know if I used JS:)
Thanks again
cheers