https://github.com/abdohurbly/easy-http2-angular
https://github.com/abdohurbly/easy-http2-angular
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abdohurbly/easy-http2-angular
- Owner: Abdohurbly
- Created: 2023-03-12T10:26:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T10:28:02.000Z (over 2 years ago)
- Last Synced: 2023-07-29T14:36:28.315Z (about 2 years ago)
- Language: TypeScript
- Size: 113 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Easy-Http2-Angular (Angular)
### Authers: Abdulwahab Herbli - Tasnim Kasab
## Installation:
npm i easy-http2-angular@latest
## Basic Usage:
#### Import EasyHttpService in your Service as following:import { EasyHttpService } from 'easy-http2-angular';
#### Here is an example for basic usage:
async getProducts() {
return = await this.httpHelper.get(baseUrl, headers,params);
}## Advance Usage:
#### Import EasyHttpService in your Service as following:import { EasyHttpService } from 'easy-http2-angular';
#### All the http request functions are genaric type < T > example usage:async getProducts(): Promise {
const product: HttpResponseType =
await this.httpHelper.get | String>(baseUrl,headers, params);
if (product.status) {
return product.data;
}
return product.msg
}#### In this case, `HttpResponseType` is:
export interface HttpResponseType {
status?: Boolean;
data?: T;
msg?: String
}