2020-10-30 15:22:35 +01:00
|
|
|
import { HttpClient, HttpHeaderResponse, HttpHeaders } from '@angular/common/http';
|
|
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
import { environment } from 'src/environments/environment';
|
|
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
|
providedIn: 'root'
|
|
|
|
|
})
|
|
|
|
|
export class HttpService {
|
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient) { }
|
|
|
|
|
|
|
|
|
|
post(serviceName:string, data:any){
|
2023-10-25 09:08:49 +01:00
|
|
|
const headers = new HttpHeaders();;
|
2020-10-30 15:22:35 +01:00
|
|
|
const options = {header: headers, withCredentials: false};
|
|
|
|
|
const url = environment.apiChatUrl+serviceName;
|
|
|
|
|
const body = {"user": "admin","password": "tabteste@006"};
|
|
|
|
|
|
|
|
|
|
return this.http.post(url, /* JSON.stringify( */data/* ), options */)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get(serviceName:string, options:any){
|
|
|
|
|
const url = environment.apiChatUrl+serviceName;
|
|
|
|
|
return this.http.get(url, options);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|