solvice-js-client
Version:
A JavaScript client to access the Solvice api.
28 lines (24 loc) • 640 B
text/typescript
declare var require : Function;
var reqwest = require('reqwest');
export class HttpClient {
public static get(url: string, success?: Function, error?: Function) {
reqwest({
url,
success,
error,
type: 'json',
method: 'get'
});
}
public static post(url: string, data: any = {}, success?: Function, error?: Function) {
reqwest({
url,
data: JSON.stringify(data),
type: 'json',
contentType: 'application/json',
method: 'post',
success,
error
});
}
}