angular-httpclient Questions

1

Solved

I have a server call which may return HTTP 202. Influenced by this SO thread, I have the following: this.http.get(url) .pipe( map(response => { if (response.status === 202) { throw response...
Bauxite asked 27/7, 2018 at 22:3

2

Solved

I updated my Angular project to Angular 6 and don't know how to do http get requests. Thats how I did it in Angular 5: get(chessId: string): Observable<string> { this.loadingPanelService.te...
Ethic asked 8/6, 2018 at 11:32

1

Solved

I generated my entities components and services according to my model using this tool. Everything worked fine, but I ran into a problem when trying to log a user in my API (that is functional). ...
Rob asked 7/7, 2018 at 16:13

1

Solved

I am trying to retrieve some data with HttpClient in Angular. My code looks like as follows: getData(suffurl: string, id?:number): Observable<any[]> { return this.http.get<any[]>('loc...
Approximal asked 6/7, 2018 at 8:52

3

Solved

Using the HTTP Client, I'm to retrieve a JSON file which resides the assets directory within my Angular 6 App which was generated using the CLI. While I know there are a couple related questions (a...
Furbelow asked 21/6, 2018 at 17:5

1

Solved

I'm using the code below to try to extract a value (ReturnStatus) from the response headers; Keep-Alive: timeout=5, max=100 ReturnStatus: OK,SO304545 Server: Apache/2.4.29 (Win32) OpenSSL/1.0.2m ...
Comestible asked 21/6, 2018 at 12:32

2

Solved

I have the following Angular http.service.ts which I use to call the /login API. login(user: User) { console.log("logging in"); console.log(JSON.stringify(user)); this.http .post<any&...
Obese asked 9/6, 2018 at 23:54

3

Solved

I have an auth-interceptor.service.ts to handle the requests import {Injectable} from '@angular/core'; import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angula...

3

I hope everyone is doing great. I've recently started working with angular 4.4, i've been trying to post data to my api server, but unfortunately it's not working. I've spent like 2 days on it but ...

2

Solved

i'm using the HttpClientModule on ionic 3, and i want to do a get on my api let email = "[email protected]"; let password = "password"; let headers = new HttpHeaders(); this.http.get('http...
Pungent asked 29/5, 2018 at 19:54

4

Solved

I have a project which contains a service (which gets the data) and a component (displays it). I would like the keep the code to the minimum on the app.component.ts. In the service I have: getPosts...
Aylesbury asked 28/5, 2018 at 16:25

1

Solved

Before angular's new HttpClient was introduced, our objects returned from the http api call could be validated with the instanceof keyword. they no longer can with the HttpClient Module. I'm trying...
Prescind asked 21/5, 2018 at 15:51

3

Solved

I have some categories in a formcontrol, I send them in an array of string like this: [1,4,6] And that is my actual code: let categoryIds = new Array<String>() this.selectedCategories....
Ruche asked 16/10, 2017 at 2:1

1

I am trying to inject the HttpClientModule manually which runs outside independent(may be!) from app. Before static injector i was using reflective injector and code was working fine but now that r...
Spense asked 1/5, 2018 at 14:54

1

I have written first test to test service class: service class: import { Injectable } from '@angular/core'; import {HttpClient} from '@angular/common/http' import {IComment} from "../../models/co...
Clovah asked 20/4, 2018 at 11:3

3

Solved

I am learning unit testing and Angular, so I am beginner in both. I have referred several tutorials and articles available on unit testing http in angular. I am not able to understand that what do...
Valer asked 20/4, 2018 at 13:6

3

Our project is migrating to Angular4, and use @angular/common/http Httpclient as the default network tool. But I found there are no body params in delete function. How do I add the body to delete f...
Alysaalyse asked 5/9, 2017 at 7:18

1

Solved

I want to test an HTTP call error response with the HttpClientTestingModule. This works fine until I add a rxjs retry(2) to the HTTP call. Then, the test obviously complains that an unexpected requ...

1

Solved

I'm using Angular and rxjs 5.x.x . For each http request I must log the response in a centralized place -either if success or fail. The problem which i'm facing is in a cituation where a catch cla...
Hypabyssal asked 20/2, 2018 at 20:16

2

Solved

So I finally decided to catch up with the times and migrate some old angular Http stuff to HttpClient. The app used to run on a bunch of Promise based code, which has since been removed (mostly). ...
Corporative asked 1/2, 2018 at 11:5

1

I'm just trying to prerender an component with Angular Universal which fetches data with httpClient from the /static folder within the app itself. How do I use httpClient correctly in Angular Uni...

2

Solved

I'm trying to retrieve an xml from a SOAP API using the HttpClient from Angular This is what's on my app.component.html: <input type="submit" value="test POST" (click)="onClickMe()"/> Thi...
Abettor asked 7/11, 2017 at 13:49

1

Solved

I am trying to develop a frontend application using Angular. Since I added the authorization header to the HTTP POST and GET requests, I'm getting 405 Method Not Allowed, although I seemingly allow...
Caddell asked 7/1, 2018 at 17:14

1

I have migrated my Angular 4 service from old Http to the new HttpClient. A request that is returning plain zero 0 as the response, is returning an observable with null. The request: return this....
Arable asked 5/10, 2017 at 7:42

1

Solved

The documentation for HttpClient states the following about immutability: Interceptors exist to examine and mutate outgoing requests and incoming responses. However, it may be surprising to lea...
Simonides asked 21/12, 2017 at 17:48

© 2022 - 2024 — McMap. All rights reserved.