title: Bad request status 400. Required String parameter 'login' is not present
body: <p>I am trying to build login with react.js and connect it to my springboot. </p>
  
  <p>Here is my code, react.js:</p>
  
  <pre><code>import React from 'react';
  
  
  export default class Login extends React.Component {
  constructor() {
      super();
      this.state = {
          login:"",
          password:""
      }
  }
  
  // This will be called when the user clicks on the login button
  login(e) {
      e.preventDefault();
      console.log(this.state.password)
  
      function createCORSRequest(method, url) {
          var xhr = new XMLHttpRequest();
          if ("withCredentials" in xhr) {
  
              // Check if the XMLHttpRequest object has a "withCredentials" property.
              // "withCredentials" only exists on XMLHTTPRequest2 objects.
              xhr.open(method, url, true);
  
          } else if (typeof XDomainRequest != "undefined") {
  
              // Otherwise, check if XDomainRequest.
              // XDomainRequest only exists in IE, and is IE's way of making CORS requests.
              xhr = new XDomainRequest();
              xhr.open(method, url);
  
          } else {
  
              // Otherwise, CORS is not supported by the browser.
              xhr = null;
  
          }
          return xhr;
      }
  
      var xhr = createCORSRequest('POST', "http://localhost:8080/test/login");
      if (!xhr) {
          throw new Error('CORS not supported');
      }
          fetch().then(r =&gt; r.json())
              .then(data =&gt; console.log(data))
              .catch(e =&gt; console.log(e))
  }
  
  render() {
  
      return (
          &lt;form role="form"&gt;
              &lt;div&gt;
                  &lt;input type="text" name="login" placeholder="Username" /&gt;
                  &lt;input type="password" name="password" placeholder="Password" /&gt;
              &lt;/div&gt;
              &lt;button type="submit"onClick={this.login.bind(this)}&gt;Login&lt;/button&gt;
          &lt;/form&gt;
      );
  }
  }
  </code></pre>
  
  <p>And this is my springboot code that is located as TestController:</p>
  
  <pre><code>@RestController
  public class TestController {
  
  @RequestMapping(value = "/test/login", method = RequestMethod.GET )
  public Boolean testLogin(@RequestParam String login, @RequestParam String password) {
      if ( login.equals ("ajt"))
  
      return true;
      else {
          return false;
      }
  }
  </code></pre>
  
  <p>Each of them are present in two different ports, react on :9000 and springboot on :8080.</p>
  
  <p>Also, on my react page I get the error:</p>
  
  <pre><code>TypeError: Failed to execute 'fetch' on 'Window': 1 argument required, but only 0 present.(…)
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>for info: I have only got 6 months coding behind me -_- please be kind!</p>