badman-rest-starter
TypeScript icon, indicating that this package has built-in type declarations

0.0.19 • Public • Published

HttpClient MicroSoftware

Demo API:

export default class BadmanRest {
    async main(){
        let logger:Logger = (await SingletonObjectFactory2.initWithArgs<Logging>(Logging,['log4js_properties.json'])).logger(BadmanRest.name);

        let rest:RestTemplate =  await SingletonObjectFactory2.initWithArgs<RestTemplate>(RestTemplate,[new AxiosHttpClientRequestFactory()]);

        // let response:HttpClientResponse = await rest.post<Object,Object>('http://192.168.1.27:6999/testA',JSON.stringify({ss:'sssss'}));

        let response:HttpClientResponse = await rest.get<Object,Object>('http://192.168.1.27:6999/testB',{aaa:'sssss'});
        logger.debug(response.body());
    }
}

Package Sidebar

Install

npm i badman-rest-starter

Weekly Downloads

7

Version

0.0.19

License

MIT

Unpacked Size

52.8 kB

Total Files

52

Last publish

Collaborators

  • badmanmaster