From 801ce0c9894c986b7d5d88aa5ef76c415cc5a354 Mon Sep 17 00:00:00 2001 From: saravanan-coder <54184780+saravanan-coder@users.noreply.github.com> Date: Tue, 22 Feb 2022 17:43:07 +0530 Subject: [PATCH] Issue in posting data through FETCH method I have extra option {'content-type':'application/json'} as it is not able to post the datas in Fetch method.After adding this option it is working properly --- src/App.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.js b/src/App.js index b335d06..535a6f8 100644 --- a/src/App.js +++ b/src/App.js @@ -12,6 +12,7 @@ function App() { try { let res = await fetch("https://httpbin.org/post", { method: "POST", + headers:{'Content-Type':'application/json'}, body: JSON.stringify({ name: name, email: email,