From 611c9da62c2e266f9facd97dc9f340ce311060a3 Mon Sep 17 00:00:00 2001 From: asgar Date: Fri, 1 Mar 2019 15:32:47 +0530 Subject: multiple asible servers support multiple asible servers support for CDT Issue-ID: APPC-1510 Change-Id: Id1b1b02274487cfbf6f108a57211a192924a6b08 Signed-off-by: Mohamed Asgar Samiulla --- src/app/shared/services/httpUtil/http-util.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/app/shared/services/httpUtil/http-util.service.ts') 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) -- cgit 1.2.3-korg