aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/src/app/serve1.service.ts
blob: a35733a9453636cfa6c72fb8480f458291bad88a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

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

  constructor(private http: HttpClient) { }

  /*getNumbers() {
    return this.http.get<string[]>(`http://localhost:5000/api/kontroler/`);
  }*/

  sendNumbers(a: number, b: number) {
    let header: HttpHeaders = new HttpHeaders({
      'Content-type': 'application/json',
    });
    return this.http.post(`http://localhost:5000/api/kontroler/`, {a, b }, { headers: header, responseType: 'text' });
  }
}