I am trying to use the API url. I am calling the API with the code below.
import {HttpClient, HttpClientModule, HttpParams} from "@angular/common/http"; @Injectable() export class PropertyPrefService { constructor(private http: HttpClient, private configurationService:Configuration) {} public searchProjects(propFilter:string):any{ let temp:any; const options = propFilter ? { params: new HttpParams().set('query', propFilter) } : {}; return this.http.get<any>(this.configurationService.propertySystemApiUrl, options) .subscribe((results:any) => { console.log(results); }); }
In Angular code, I don't get any response and get an error message:
Http error response for (unknown url): 0 Unknown error. "
However, when I make a request, if I open the developer tools in Chrome, I see that the answer is received from the server.
The URL is "https: // ...", not "http: // ...".
source share