Advertisement
anonymousvntk

Untitled

Aug 11th, 2021
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. var axios = require('axios');
  2.  
  3. var config = {
  4. method: 'get',
  5. url: 'https://demo.ip-api.com/json/1.55.170.125?fields=66842623&lang=en',
  6. headers: {
  7. 'Connection': 'keep-alive',
  8. 'sec-ch-ua': '"Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"',
  9. 'sec-ch-ua-mobile': '?0',
  10. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36',
  11. 'Accept': '*/*',
  12. 'Origin': 'https://ip-api.com',
  13. 'Sec-Fetch-Site': 'same-site',
  14. 'Sec-Fetch-Mode': 'cors',
  15. 'Sec-Fetch-Dest': 'empty',
  16. 'Accept-Language': 'en-GB,en;q=0.9,en-US;q=0.8,vi;q=0.7'
  17. }
  18. };
  19.  
  20. axios(config)
  21. .then(function (response) {
  22. console.log(JSON.stringify(response.data));
  23. })
  24. .catch(function (error) {
  25. console.log(error);
  26. });
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement