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

@Injectable({
  providedIn: 'root'
})
8
9
10



11
12
13
14
15
export class ParseXmlService {

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

27
}