I am using axios post method, but seems my backend can not get the data, not sure if it's because of the data format? Couse when I test backend code with pure javascript fetch method, it works fine. Not sure how to fix it? Thank you for any suggestion.
axios Dev tool screenshot(backend can not get data):

Java script fetch Dev tool screenshot(works fine)

React js code:
export default class PersonList extends React.Component {
constructor () {
super();
this.state = {
doctorid: '',
plandate: '',
starttime: '',
endtime: '',
};
this.handleChange = this.handleChange.bind(this);
}
handleChange (evt, field) {
// check it out: we get the evt.target.name (which will be either "email" or "password")
// and use it to target the key on our `state` object with the same name, using bracket syntax
this.setState({ [field]: evt.target.value });
}
handleSubmit = event => {
event.preventDefault();
const userObject = {
doctorid: this.state.doctorid,
plandate: this.state.plandate,
starttime: this.state.starttime,
endtime: this.state.endtime
}
axios.post(`http://localhost:80/reacttest/src/api/api?action=apptPlan`,userObject, {
headers: {
'Content-type': 'application/json'
}
})
.then(res => {
console.log(res);
console.log(res.data);
}).catch((error) => {
console.log(error)
});
// this.setState({ doctorid: '', plandate: '', starttime: '', endtime:''})
}
render() {
return (
<div>
<form onSubmit={this.handleSubmit}>
<label>
<h5>Person doctorid:</h5>
<input type="text" name="doctorid" onChange={(event)=>this.handleChange(event, "doctorid")} />
<h5>plandate</h5>
<input type="text" name="plandate" onChange={(event)=>this.handleChange(event, "plandate")} />
<h5>starttime</h5>
<input type="text" name="starttime" onChange={(event)=>this.handleChange(event, "starttime")} />
<h5>endtime</h5>
<input type="text" name="endtime" onChange={(event)=>this.handleChange(event, "endtime")}/>
</label>
<button type="submit">Add</button>
</form>
</div>
)
}
}