Error in the external response?

0

I want to make a request to an external URL. The response you send is a string separated by "|" Ejmple: "una | ves". My code of the method of my service:

    getDatosPersonaFromReniec(numerDni: string) {
    let nombreApellido;
    /*$.ajax({
      url: "http://aplicaciones007.jne.gob.pe/srop_publico/,
      crossOrigin:true,
      dataType:"jsonp",
      success: (data) => {
        console.log(data);
      }
    })*/
    let headers = new HttpHeaders().append("Content-type", "text/plain")

    this.http.get<string>("/srop_publico/Consulta/Afiliado/GetNombresCiudadano?DNI=" + numerDni + "", {responseType:'text'}).pipe(map(data => {
      return JSON.stringify(data)
    })).subscribe(da => console.log(da))

  }

but I get an error:

some way to fix it?

    
asked by Dante Aligeri 08.12.2018 в 16:43
source

0 answers