title: parsererror: Unexpected token r in JSON at position 0
body: <p>I have a spring mvc application. I am trying to send a http post request using the below method:</p>
  <pre><code>$.ajax({
          type: 'POST',
          url: '/suggested-events/vote/'+votedEventId,
          success: function(response) { console.log(&quot;Hey: &quot;+JSON.parse(response)); },
          
          error: function(XMLHttpRequest, textStatus, errorThrown) {
             console.log(&quot;TextStatus: &quot;+textStatus);
             console.log(&quot;ErrorThrown: &quot;+errorThrown);
          },
          contentType: &quot;application/json&quot;,
          dataType: 'json'
      });
  </code></pre>
  <p>the http post request successfully triggers the below rest controller method:</p>
  <pre><code>@PostMapping(&quot;/suggested-events/vote/{votedEventId}&quot;)
      public ResponseEntity&lt;String&gt; voteForASuggestedEvent(@PathVariable Long votedEventId){
          log.info(&quot;You have made a vote for: &quot;+votedEventId);
                  HttpHeaders responseHeaders = new HttpHeaders();
  
      return new ResponseEntity&lt;String&gt;(&quot;responseHeaders&quot;, responseHeaders, HttpStatus.CREATED);
  
      }
  </code></pre>
  <p>But as you see, I am interested to receive, and print the response data in my console:</p>
  <pre><code>success: function(data) { console.log(&quot;Hey: &quot;+data); }
  </code></pre>
  <p>The problem is:  <strong>nothing happens in my console</strong></p>
  <p><em>I am sure the BackEnd receives the request and provides an answer.</em></p>
  <p>The below image shows the rest response reaches to the Network inspect in browser console</p>
  <p><a href="https://i.stack.imgur.com/l0TSp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l0TSp.png" alt="enter image description here" /></a></p>
  <p>But it does not get printed in console</p>