score:1

Accepted answer

since the data is json-encoded, you need to use the correct content type in your request:

headers: {
  'content-type': 'application/json',
}

or, even easier, let axios take care of it (because it defaults to json):

const config: axiosrequestconfig = {
  method: 'post',
  url:    url,
  data:   {
    username: e.target[0].value,
    email:    e.target[1].value,
    password: e.target[2].value
  }
}

Related Query

More Query from same tag