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?