Questions tagged httpclient

Explore the latest questions and answers asked by our top developers.

Angular, the newly added item can only be deleted after refresh

I’m working on an Angular 12 project, and I’m storing the data using JSON-server. The CRUD operations are working fine. But when I add a new item, using the form, the delete and update buttons won’t work, unless I refresh the page. This the error I get in the console , after I click on […]

How to intercept HTTP calls from the angular web component on the hosting angular application?

I have a need to intercept the HTTP calls inside the web component to append the headers like Authorization token. The headers need to be appended from the parent or hosting application. Not sure if this can be done through the intercepter. Source: Angular Questions

Getting the http post canceled when subscribing from a service

Stuck in this error for a week. Cannot send a simple post request to the heroku server using the Angular HttClient. Defined all the services in the provider section in the main app Module. The Error Handling service is not logging any error after sending the post request(This service works fine that i have tested […]

By Patrick Prakash
Published
Categorized as angular, api, httpclient, node.js, rxjs Tagged , , , ,

Angular HttpErrorResponse GET Request

I have a simple Quarkus project and want to show the data in an Angular table with HttpClient. I also have a CORS Filter. Anyway, I get the following error: Angular table with no date, HttpErrorResponse Status 0 service.ts import { HttpClient } from ‘@angular/common/http’; import { Injectable } from ‘@angular/core’; import { Observable } […]

By brainfock
Published
Categorized as angular, httpclient, java, rest, typescript Tagged , , , ,

404 API request with pagination in prod mode but works in dev

I use a Laravel API and an Angular service to make my application. I’m doing a pagination for my array with Angular and I make a HTTP request with this function in my service : getPagination(page): Observable<any> { return this.httpClient.get<any>(environment.apiBaseUrl + ‘test/?page=’ + page); } When I trigger it I get the data with the […]

By leri
Published
Categorized as angular, api, httpclient, laravel Tagged , , ,

Why does my UI freeze until the api call is terminated?

I have an api call that download all italian municipalities, that is nearly 8000. The problem is that the page load the html, but I can’t click anything until the api call is over. ngAfterViewInit(){ this.loadComuni(); } loadComuni(){ //Italian municipalities this.RegisterService.getMunicipalities().subscribe( obj=>{ this.city=obj; }, error=>{ console.log("error", error); }); } <div class="col-12 col-lg-4""> <select id="cbComNasc" class="form-control" […]

By Niccol Bertozzi
Published
Categorized as angular, api, html, httpclient, javascript Tagged , , , ,

Angular typescript Async HTTPClient call

I have a problem. In my angular project I am trying to do a Http POST call, to login in my website. I provide the call with an username and password. If the API endpoint returns null, the login failed and if the endpoint returns an Account object it succeeded. The code to make the […]

By A Vreeswijk
Published
Categorized as angular, httpclient, typescript Tagged , ,

Simple Angular 12 HttpClient ending with CORS error

I tried to write just basic httpClient in Angular 12 with application served on localhost:4200: login(username:string, password:string) { var request = { name: username, password: password } return this.http.post("http://192.168.200.242:18505/api/login", request) } I tried every possible solution I found on internet, making proxy.json file (maybe I was doing it wrong), chrome extensions to disable CORS, but […]

By Raadush
Published
Categorized as angular, cors, httpclient Tagged , ,

Angular Asynchronous function with HttpClient

Ok, So I’ve been scratching my head over this all day. Essentially, I have a button that would withdraw a student from a class. That part is simple enough. HOWEVER, it is supposed to also check the database for a waiting list for that class, and enroll the next person in line if there is […]

How to use ‘this’ in Promise?

I am trying to make an http request inside a Promise function. I get the this.http.post is undefined error… I know that I somehow have to access this some other way but I did not understand how to do it :/ Anyone willing to help me out? Thanks!! doUpload(files: Array<File>): Promise<Array<UploadResult>> { console.log(files); return new […]

By papafredo6
Published
Categorized as angular, httpclient, post, typescript, undefined Tagged , , , ,
1 2 3 17

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq