Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch('https://crackitindonesia.net/members/api/auth/ver2/login/', {
- ////this second argument containing method and body determines that this request is a POST request and what information will be sent to the API.
- method: 'POST',
- body: JSON.stringify({id: '200'})
- }).then(response => {
- if (response.ok){
- return response.json();
- }
- throw new Error('Request failed!');
- }, networkError => {
- console.log(networkError.message);
- }).then(jsonResponse => {
- return jsonResponse
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement