title: POST url 500 (Internal Server Error)
body: <p>I'm having issues in running a ajax on a webserver.
  Whenever I try to run the program on Visual Studio, it works perfectly fine with the localhost. But comes up with POST  500 (Internal Server Error)</p>
  
  <p>I've had a look online what can solve this issue and I've tried adding a meta tag containing a csrf token. But still didn't work.</p>
  
  <p>Here is the error that's coming up:
  <a href="https://i.stack.imgur.com/LOBps.png" rel="nofollow noreferrer">POST Internal Server Error 500 Screenshoot</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    if (m) {
          // generate the image data
          var image_NEW = document.getElementById("canvas").toDataURL("image/jpeg");
          image_NEW = image_NEW.replace('data:image/jpeg;base64,', '');
  
          $.ajaxSetup({
              headers: {
                  'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
              }
          });
  
          $.ajax({
              type: 'POST',
              url: 'Default.aspx/SaveImage',
              data: '{ "imageData" : "' + image_NEW + '" }',
              contentType: 'application/json; charset=utf-8',
              dataType: 'json',
              success: function (msg) {
                  alert('Image saved to your root Folder !');
              }
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance</p>