score:1

Accepted answer

You can solve this by stringifying your AJAX payload, as follows:

getCompare() {
    let data = JSON.stringify({value: this.state.inputValue, from: this.state.compareFrom, to: this.state.compareTo })
    $.ajax({
      url: '/api/sources/compare',
      type: 'POST',
      data: data,
      contentType: 'application/json'
    })
  }


Related Query

More Query from same tag