Http module synchrone or asynchrone?


#1

Hello,
Could you tell me if the Http module makes asynchronous request ?
If not could you tell me a plugin which makes asynchronous request and with we can parse the result with json ?
Cordially


#2

Here is an example of my http.service.ts file getting data from the server.

import { HttpClient, HttpHeaders, HttpResponse } from "@angular/common/http";
import { Observable as RxObservable } from "rxjs";

@Injectable()
export class MyHttpGetService {
    private serverUrl = this.config.apiEndpoint;
constructor(private http: HttpClient){}

getStudentList(args): RxObservable<Object> {
        return this.http.get(`${this.serverUrl}${this.listService}${params}`, {headers: reqheaders})
        .pipe(
            map((res)=>{return res})
        );
    }

}

#3

Ok thank you.
But could you tell me if the request is synchronous or asynchronous ?


#4

asynchronous. It returns an Observable.


#5

All http calls are asynchronous, it runs on a separate thread internally.