Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://deno.land/
- // fetch_deno.js
- let url = 'https://www.premint.xyz/'
- fetch(url).then(async res => {
- console.log(await res.text())
- console.log('\x1b[32m', 'deno fetch status (then)', '\x1b[0m', res.status)
- }).catch(async err => {
- console.log(err)
- console.log('\x1b[31m', 'deno fetch status (catch)', '\x1b[0m', err.status)
- })
- // https://nodejs.org/
- // fetch_node.js
- const axios = require('axios')
- let url = 'https://www.premint.xyz/'
- axios.get(url).then(res => {
- console.log(res.data)
- console.log('\x1b[32m', 'node axios status (then)', '\x1b[0m', res.status)
- }).catch(err => {
- console.log(err.response.data)
- console.log('\x1b[31m', 'node axios status (catch)', '\x1b[0m', err.response.status)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement