title: How to use $.ajax with then()?
body: <p>I use AJAX to send some data to my apache/php webserver (XAMPP). 
  I already got it running with the shorthand syntax $.post, the code looks like this:</p>
  
  <pre><code>return $.post('http://localhost:8099/login.php', {
        loginDataInput : loginDataInput
      }).then((response) =&gt; {
        //response = JSON.parse(response)
        return response
      })
  </code></pre>
  
  <p>But now I'm trying to use the long form, $.ajax, like this:</p>
  
  <pre><code>return $.ajax({
        type:"POST",
        url: 'http://localhost:8099/login.php',
        data: loginDataInput
    }).then((response) =&gt; {
      return response
    })
  </code></pre>
  
  <p>And it doesnt seem to work. 
  I debugged the $_POST array on php side, the datainput itself is changed, the dots become underscores when I use $.ajax syntax (see below). How do I prevent that?</p>
  
  <p>$_POST array echoed via json_encode after AJAX call with $.post syntax:</p>
  
  <pre><code>{"loginDataInput":"{\"loginDataMailInput\":\"gruss@imbus.de\",\"loginDataPasswordInput\":\"test2\"}"}
  </code></pre>
  
  <p>$_POST array echoed via json_encode after AJAX call with $.ajax syntax:</p>
  
  <pre><code>{"{\"loginDataMailInput\":\"gruss@imbus_de\",\"loginDataPasswordInput\":\"test2\"}":""}
  </code></pre>
  
  <p>For my $.ajax version I used the jquery Doc 
  <a href="https://api.jquery.com/jQuery.post/" rel="nofollow noreferrer">https://api.jquery.com/jQuery.post/</a>
  Which showed me the $.ajax equivalent to the $.post shorthand. 
  I left out datatype because I want to use intelligent guess. Maybe this is the problem?</p>