aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/shared/services/httpUtil/http-util.service.ts
diff options
context:
space:
mode:
authorasgar <ma926a@us.att.com>2019-03-08 19:52:33 +0530
committerAsgar Samiulla <ma926a@us.att.com>2019-03-15 10:53:58 +0000
commitaf56b68e030085aa523152e83811705636ead79c (patch)
tree088c8faafb77a79a5fcc4001877dc13af4ffe936 /src/app/shared/services/httpUtil/http-util.service.ts
parenteedac3e312c66499ca5ff9d72388c31b25813225 (diff)
added ansible server functionality
multiple ansible server for CDT Issue-ID: APPC-1510 Change-Id: I383bc63705418654efb596c617309821ebbeb9b4 Signed-off-by: Mohamed Asgar Samiulla <ma926a@us.att.com>
Diffstat (limited to 'src/app/shared/services/httpUtil/http-util.service.ts')
-rw-r--r--src/app/shared/services/httpUtil/http-util.service.ts9
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)