yfe-server
v1.0.7
Published
This is a package for requesting http/https in web application, we support jsonp and normal method like get and post.
Downloads
3
Readme
Installation
import Server from 'yfe-server'
Usage
class myServer extends Server {
async getInformation(params, options) {
try {
let result = await this.axios('get', 'http://yourbaseurl.com', '/getinformation',params, options)
return result
} catch(err) {
throw err
}
}
}
Api
this.axios(method, baseUrl, url, [params, options])
parameters
params: are the URL parameters to be sent with the request, Must be a plain object or a URLSearchParams object
also see params in axiosoptions: it can overwrite the options in aixos, so you can add whatever you what when you send a request