Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constructor(props) {
- super(props)
- this.state = {
- Nik: '',
- UserPassword: ''
- }
- }
- UserLoginFunction = () =>{
- const { Nik } = this.state ;
- const { UserPassword } = this.state ;
- fetch('url', {
- method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- user: Nik,
- pass: UserPassword
- })
- }).then((response) => response.json())
- .then((responseJson) => {
- console.log(responseJson)
- })
- .catch((error) => {
- console.log(error)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement