Package Exports
- nyro
Readme
A simple and effective promise-based HTTP request library that supports all HTTP methods.
Installation
Using npm:
$ npm install nyroOther Installations:
$ yarn add nyro$ pnpm add nyroUsage
import nyro, { ContentType, ResponseEncoding, ResponseType, StatusCode, Method } from 'nyro';
(async() => {
var response = await nyro({
url: 'https://hercai.onrender.com/v3/hercai',
params: {
question: 'Hi How Are You?'
}
method: Method.Get,
responseType: ResponseType.Json,
headers: {
'Authorization': '...someOneSecretKey',
'User-Agent': 'Nyro'
},
bodySchema: {
content: String,
reply: String
}
});
var body = response.body;
console.log('Your Question; ' + body.content);
console.log('AI Reply; ' + body.reply);
})();For Fake UserAgent
import nyro, { userAgentGenerator } from 'nyro';
nyro({
url: 'https://someoneapi.com',
method: 'GET',
headers: {
'User-Agent': userAgentGenerator()
}
}).then((response) => {
console.log(response.config.headers);
console.log(response.body);
});License
nyro is licensed under the MIT License. See the LICENSE file for details.