Fetch API cannot load the url. Response for preflight is invalid (redirect)
<p>I use fetch to call a post service and I get the error <code>Fetch API cannot load http://localhost:8080/user/login</code>. Response for preflight is invalid (redirect)'. <code>Status code: 302 Found.</code> The variable 'data' is a json <code>object {email: "batman@dc.com", password: "111"}</code></p>

<pre><code>   fetch('http://localhost:8080/user/login', {
        method: 'post',
        body : JSON.stringify(data),
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        },
        dataType : 'json'
    })
</code></pre>