Untitled
4 years ago in Plain Text
class App extends React.Component
{
render()
{
return (
<form>
<h1>Авторизация</h1>
<input type = "text" name userName placeholder = "Логин"/>
<input type = "text" name Password placeholder = "Пароль"/>
<button>Авторизоваться</button>
</form>
);
}
}
fetch('http://example.com',{
method: "POST",
body: JSON.stringify(userData),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
}).then(response => {
response.json().then(data =>{
console.log("Successful" + data);
})
})