Advertisement
crackit-id

gemlog

Apr 7th, 2025
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fetch('https://crackitindonesia.net/members/api/auth/ver2/login/', {
  2.   ////this second argument containing method and body determines that this request is a POST request and what information will be sent to the API.
  3.   method: 'POST',  
  4.   body: JSON.stringify({id: '200'})
  5. }).then(response => {
  6.   if (response.ok){
  7.     return response.json();
  8.   }
  9.   throw new Error('Request failed!');
  10. }, networkError => {
  11.   console.log(networkError.message);
  12. }).then(jsonResponse => {
  13.   return jsonResponse
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement