我使用axios发送了来自laravel的发帖请求,但返回了空值
我的构造函数:
constructor(props) {
super(props);
this.state = {
user: [],
search: ""
};
}
react功能:
handlChange = (e) => {
this.setState({
search: e.target.value
})
}
submitSearch = (e) => {
e.preventDefault();
axios.post('/search', this.state.search)
.then(res => {
})
}
控制器功能:
public function search(Request $request){
return dd($request->search);
}