botrest
api-rest for bot development
introduction
this is an axio-based repository for requesting endpoints that use cookies for data authentication and website scraping.
usage
to use, import the modules using an npm install botrest --save
and import into your project.
const botrest = require('botrest');
const rest = new botrest('https://iqoption.com/', null)
rest.get('/api/appinit', null).then(rest => {
console.log(rest)
})
suport
the system currently supports requests in POST and GET methods
- NOTE: if the endpoints do not use body and or query, consider entering a null value:
get('/endpoint', null)
- post('/endpoint', null, null)
rest.get('/endpoint', {query: 'string'})
rest.post('/endpoint', {body: 'string'}, {query: 'string'})
Form Data
POST and GET formData methods are used to return absolute values of requests made.
these values can be filled with:
- endpoint
- body
- query
- header
- encoding
rest.getFormData('/endpoint', {query: 'string'}, {header: 'string'}, 'utf8')
rest.postFormData('/endpoint', {query: 'string'}, {body: 'string'}, {header: 'string'}, 'utf8')
some extra functions used are:
- return of cookies
- definition of agents
var cookie = rest.cookie()
console.log(cookie)
var agt = rest.agtController('any')
console.log(agt)