Ejemplo
https://cdn.apiwant.xyz/api/neko-nsfw
cdn.apiwant.xyz
fetch('https://cdn.apiwant.xyz/api/neko-nsfw', {
headers: { 'Authorization': 'token' }
})
.then(response => response.json())
.then(data => console.log(data.url))
import requests
headers = { 'Authorization': 'token' }
response = requests.get('https://cdn.apiwant.xyz/api/neko-nsfw', headers=headers)
data = response.json()
print(data['url'])
curl -H "Authorization: token" https://cdn.apiwant.xyz/api/neko-nsfw
const axios = require("axios")
client.on("messageCreate", async message => {
if (message.content === "wantapi") {
try {
const response = await axios.get('https://cdn.apiwant.xyz/api/neko-nsfw', {
headers: { 'Authorization': 'token' }
});
message.channel.send(response.data.url);
} catch (error) {
console.error('Error al hacer la solicitud a la API:', error);
message.channel.send('Hubo un error al obtener la información.');
}}
});