parse-xml.service.ts 667 Bytes
Newer Older
1
2
3
4
5
6
7
8
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { HttpClient, HttpHeaders } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class ParseXmlService {
Paulo's avatar
Paulo committed
9
 
cazenave's avatar
cazenave committed
10
  blazePath = "http://51.210.211.132:8888/blazegraph/sparql"
11
12
13

  constructor(private http:HttpClient) { }
  
Paulo's avatar
Paulo committed
14
  
Paulo's avatar
Paulo committed
15
  getXmlResult(body): Observable<any> {
16
17
18
19
20
21
    const httpOptions = {
        headers: new HttpHeaders({
          'Content-Type':  'application/x-www-form-urlencoded',
          'responseType': 'application/sparql-results+xml'         
        })
      };
Paulo's avatar
Paulo committed
22
    return this.http.post(this.blazePath,body, httpOptions);   
23
  }
Paulo's avatar
Paulo committed
24

25
}