A
A
Artem Prokhorov2021-11-27 23:10:28
JSON
Artem Prokhorov, 2021-11-27 23:10:28

Is it worth it to json everything and always when receiving/sending a request?

I mean, is there any sense, for example, to transfer POST form data while using something like this?:

fetch(domain, {
   method: "POST",
   headers: headers,
   body: JSON.stringify({
      "login": variable
   })
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Gorelov, 2021-11-27
@kotcich

No, not necessarily.
Depends on the task context. I don't think there's any hidden meaning for you either. Do as you please.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question