title: Vue.js body of post method is always empty
body: <p>I want to send <code>POST</code> method to <code>localhost</code> which some content in <code>body</code> part. My code from <code>vue</code> file is:</p>
  
  <pre><code>methods: {
        login(){
            var data = {
                username: 'admin',
                password: 'admin'
            }
          this.$http.post("http://localhost:8081/login", data)
          .then(response =&gt; {
            console.log(response)
          })
        }
      }
  </code></pre>
  
  <p>I use Spring-boot as server and have breakpoint in <code>attemptAuthentication</code> method from implementation of <code>AbstractAuthenticationProcessingFilter</code> class. For check <code>body</code> I use:</p>
  
  <pre><code>String myBody= httpServletRequest.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
  </code></pre>
  
  <p>but this <code>String</code> is always empty(breakpoint works). I tried put some value manually to <code>post</code> method like:</p>
  
  <pre><code>this.$http.post("http://localhost:8081/login", "exampleData")
  </code></pre>
  
  <p>but value is still empty.</p>
  
  <p>When I send the same method from Postman - it works very well - <code>myBody</code> contains correct value.</p>
  
  <p>What is wrong with my code?</p>
  
  <p>@Update</p>
  
  <p>1) for raw and json I configured Postman:</p>
  
  <p><a href="https://i.stack.imgur.com/kCLYd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kCLYd.png" alt="enter image description here"></a>
  in my java class is:</p>
  
  <pre><code>myBody = {"username":"admin","password":"admin"}
  myContentType = application/json
  </code></pre>
  
  <p>2) For form:
  <a href="https://i.stack.imgur.com/kCLYd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/31Kfk.png" alt="enter image description here"></a></p>
  
  <p>java classes looks like:</p>
  
  <pre><code>myBody = 
  ------WebKitFormBoundarykeEtHWmW4BBv2y0t
  Content-Disposition: form-data; name="username"
  
  admin
  ------WebKitFormBoundarykeEtHWmW4BBv2y0t
  Content-Disposition: form-data; name="password"
  
  admin
  ------WebKitFormBoundarykeEtHWmW4BBv2y0t--
  </code></pre>
  
  <p>@Update</p>
  
  <p>I added header for my <code>post</code> method:</p>
  
  <pre><code>methods: {
        login(){
          this.$http.post("http://localhost:8081/login", "exampleData", {
            headers: {
              'content-type' : 'application/json'
            }
          })
          .then(response =&gt; {
            console.log(response)
          })
        }
      }
  </code></pre>
  
  <p>but in java class <code>myBody</code> is empty and <code>content-type</code> is <code>null</code>. There are no errors in console(in browse)</p>