Javascript 关于React、Restful和web服务器
我有一个像55.5.555.555这样的本地服务器。首先,我使用React创建了一个登录WebUI,我的代码在Javascript 关于React、Restful和web服务器,javascript,reactjs,rest,web-services,restify,Javascript,Reactjs,Rest,Web Services,Restify,我有一个像55.5.555.555这样的本地服务器。首先,我使用React创建了一个登录WebUI,我的代码在 class Login extends Component { constructor(props){ super(props) this.state = { un : "", pwd : "", }; } render() { return ( <div> <input type="text" /
class Login extends Component {
constructor(props){
super(props)
this.state = {
un : "",
pwd : "",
};
}
render() {
return (
<div>
<input type="text" />
<input type= "password"/>
<button type='submit'>Submit</button>
</div>
);
}}
export default Login;
类登录扩展组件{
建造师(道具){
超级(道具)
此.state={
联合国:“,
pwd:“,
};
}
render(){
返回(
提交
);
}}
导出默认登录;
我应该如何将用户名和密码发布到55.5.555.555,我尝试了3种方法,但都没有成功,您如何提交这些值?使用
onChange
作为用户名和密码,并使用“onSubmit”提交表单。请显示用于向服务器发送数据的代码