嘿所以我有一个文本框/ FormControl,它应该在this.state中更新json中的一个字段.我想知道是否有更好的方法来改变?
<FormControl
type='text'
placeholder='enter'
defaultValue={this.state.form.name}
onChange={this.handleChange.bind(this, 'name')}
/>
</FormGroup>
Run Code Online (Sandbox Code Playgroud)
`
handleChange(change, event) {
var toChange = this.state.form;
toChange[change] = event.target.value;
this.setState({form: toChange});
}
Run Code Online (Sandbox Code Playgroud) 嘿,所以POST/PUT请求就这么做了
$http.post(url, body, headers)
Run Code Online (Sandbox Code Playgroud)
工作得很好
但是使用DELETE它会得到我的身体,但完全忽略了我的标题......
$http.delete(url, body, headers)
Run Code Online (Sandbox Code Playgroud)