Newer
Older
CamaraComercioWeb / src / app / core / services / query / query.service.ts
Fabian VC on 23 Oct 2021 462 bytes [add] rest api
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class QueryService {

  constructor(private http: HttpClient) { }

  query(url: string, method: string, params?:any) {
    switch(method){
      case 'GET':
        return this.http.get(url, params);
        break;
      case 'POST':
        return this.http.post(url, params);
        break
    }
    return null;
  }
}