From eedac3e312c66499ca5ff9d72388c31b25813225 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Wed, 6 Mar 2019 12:11:34 -0800 Subject: Revert "multiple asible servers support" Some functionality was accidentally removed This reverts commit 611c9da62c2e266f9facd97dc9f340ce311060a3. Change-Id: I1aefbbc0ede8cdda59acc8bdf7b047e506aad813 Signed-off-by: Patrick Brady Issue-ID: APPC-1510 --- src/app/shared/services/httpUtil/http-util.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 688f3ea..43e6d4f 100644 --- a/src/app/shared/services/httpUtil/http-util.service.ts +++ b/src/app/shared/services/httpUtil/http-util.service.ts @@ -28,22 +28,23 @@ 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) { + 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