+2 votes
by
I get binary JSON from the server and, depending on the user's actions, a blob. How can I distinguish between them? Or do I need to write an additional login point on the server?

const res = await fetch('url')
if await res.json():
...
else:
...

2 Answers

0 votes
by
 
Best answer
Usually in the headers of the answer you write the type
+1 vote
by
This is usually written in the API docs,
...