diff options
author | asgar <ma926a@us.att.com> | 2019-03-01 15:32:47 +0530 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2019-03-04 19:52:20 +0000 |
commit | 611c9da62c2e266f9facd97dc9f340ce311060a3 (patch) | |
tree | e471d6c851cefd46ed83380c6e41d20f54fe2666 /src/app/shared/services/httpUtil | |
parent | 9ccb0353f1c59bd7d49ff17c54e5d00c0960ea82 (diff) |
multiple asible servers support
multiple asible servers support for CDT
Issue-ID: APPC-1510
Change-Id: Id1b1b02274487cfbf6f108a57211a192924a6b08
Signed-off-by: Mohamed Asgar Samiulla <ma926a@us.att.com>
Diffstat (limited to 'src/app/shared/services/httpUtil')
-rw-r--r-- | src/app/shared/services/httpUtil/http-util.service.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/app/shared/services/httpUtil/http-util.service.ts b/src/app/shared/services/httpUtil/http-util.service.ts index 43e6d4f..688f3ea 100644 --- a/src/app/shared/services/httpUtil/http-util.service.ts +++ b/src/app/shared/services/httpUtil/http-util.service.ts @@ -28,23 +28,22 @@ import { Http, Response, Headers, RequestOptions } from '@angular/http'; export class HttpUtilService { headers: Headers; options: RequestOptions - private username = require('../../../cdt.application.properties.json').username; - private password = require('../../../cdt.application.properties.json').password; + private username = require('../../../../cdt.application.properties.json').username; + private password = require('../../../../cdt.application.properties.json').password; constructor(private http: Http) { this.headers = new Headers({ 'Content-Type': 'application/json' }); // ... Set content type to JSON - this.options = new RequestOptions({headers: this.headers}); // } - get(req) { + return this .http .get(req.url, this.options) .map((res: Response) => res.json()) } - post(req) { this.headers.append('Authorization', 'Basic ' + btoa(this.username + ':' + this.password)); this.options = new RequestOptions({ headers: this.headers }); + return this .http .post(req.url, req.data, this.options) |