Top "Angular2-http" questions

For questions directly related to the use of the Http service in Angular.

How to properly download excel file with Angular2

This is the code of my service which makes post request with response an xls file : exportInternalOrder(body) { let user_…

excel angular content-type angular2-http
Angular2 - TypeError: Cannot read property 'Id' of undefined in (Typescript)

I'm getting the following error: angular2.dev.js:23925 EXCEPTION: TypeError: Cannot read property 'Id' of null in [ {{ product.Id }} in …

javascript typescript angular angular2-http
Synchronous functions - in Angular

I need to reach in the Angular synchronous functions (that the other waiting for the end of the first). For …

angular typescript rxjs angular2-http
How to submit a form using angular 2 http post function using javascript?

I've started to learning Angular2 but I want to submit a form using http.post() to my Web API but …

javascript angular angular2-http
how to mock http error for angular2 testing

I am writing unit tests for an angular2 service. Code snippets: // jasmine specfile // already injected MockConnection into Http backend.connections.…

angular unit-testing typescript angular2-http
Handling 204- No Content response in HTTP Observable - Angular2

In my Angular2 application, I am taking responses from a REST API and manipulating them in order to display them …

angular angular2-services angular2-http angular2-observables
Angular2 watch for 302 redirect when fetching resource

I have a requirement to pull a few resources from another domain held by my company. I want to pull …

angular rxjs angular2-http
How to add header to a post request in angular 2?

//In services.ts import { Injectable } from '@angular/core'; import { Http, Headers, RequestOptions } from '@angular/http'; import 'rxjs/Rx'; @…

angular angular2-http
Angular 2 - Handling multiple subscriptions on a single observable

I'm working on an Angular 2 app and need some guidance on how to handle authentication errors cleanly. My end goal …

javascript angular rxjs angular2-http
Can't have a timeout of over 2 minutes with this.http.get?

My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return. Using just the default this.http.…

angular angular2-http angular4-httpclient