title: I am getting 404 not found in my fetch post request
body: <p>I am sending post request using fetch.I am sending with jsonbody.It is working with postman but not in my reactcode.please help  </p>
  
  <p>I have set reqeust body in header.I dont know why i am getting 404 not found exception.</p>
  
  <p>here is my code</p>
  
  <pre><code>      authenticate=(loginid,passw)=&gt;
            {
              console.log(loginid,passw);
              const url ="http://localhost:8443/v2/rest/authenticateuser"; 
              var requestBody={"loginid":loginid,"passw":passw};
              console.log(requestBody);
              fetch("http://localhost:8443/v2/rest/authenticateuser",
                {
                  method: 'POST',
                    mode: 'no-cors', // no-cors, cors, *same-origin
                  cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
                  credentials: 'same-origin',
                  headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json',
  
                    },
                    redirect: 'follow', // manual, *follow, error
                  referrer: 'no-referrer', // no-referrer, *client
                  body:JSON.stringify(requestBody)
                })
              .then(res =&gt; res.json())
              .then(
                (result) =&gt; {
                   console.log(result);
                   this.props.login(result.islogin); 
                })
                .catch((error) =&gt; {
                  this.setState({show:false});
                  window.alert("error",error);
                 console.log("authentication failed");
                });
            }
  //handlesubmit as a handler for submit button
        handleSubmit = e =&gt; {
          e.preventDefault();
          this.props.manageridupdate(e.target.elements.loginid.value);
          this.authenticate(e.target.elements.loginid.value,e.target.elements.passw.value);
  
        };
  </code></pre>
  
  <p>I am getting this error.</p>
  
  <pre><code>   POST http://localhost:8443/v2/rest/authenticateuser 404 (Not Found)
      App.authenticate @ App.js:19
      App.handleSubmit @ App.js:49
      callCallback @ react-dom.development.js:147
      invokeGuardedCallbackDev @ react-dom.development.js:196
      invokeGuardedCallback @ react-dom.development.js:250
      invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:265
      executeDispatch @ react-dom.development.js:571
      executeDispatchesInOrder @ react-dom.development.js:596
      executeDispatchesAndRelease @ react-dom.development.js:695
      executeDispatchesAndReleaseTopLevel @ react-dom.development.js:704
      forEachAccumulated @ react-dom.development.js:676
      runEventsInBatch @ react-dom.development.js:844
      runExtractedEventsInBatch @ react-dom.development.js:852
      handleTopLevel @ react-dom.development.js:5029
      batchedUpdates$1 @ react-dom.development.js:21463
      batchedUpdates @ react-dom.development.js:2247
      dispatchEvent @ react-dom.development.js:5109
      (anonymous) @ react-dom.development.js:21520
      unstable_runWithPriority @ scheduler.development.js:255
      interactiveUpdates$1 @ react-dom.development.js:21519
      interactiveUpdates @ react-dom.development.js:2268
      dispatchInteractiveEvent @ react-dom.development.js:5085
  </code></pre>