angular-httpclient Questions

2

Solved

I am trying to cast a response object from an HTTP Post request in my angular project to a Person class that I have defined. I have defined a generic post method in an HTTP Service, and am calling ...
Teerell asked 1/6, 2019 at 19:58

2

Solved

In HttpClientModule, is there a method to pass headers and params to get request. import { HttpHeaders, HttpParams, HttpClient } from @angular/common/http'; const headers = { headers: new HttpH...

1

I have an angular component that will POST some data to a URL in our app, and then does nothing else since no data is returned back from that post. I am having trouble testing this since normally H...
Decline asked 29/4, 2019 at 19:3

4

Solved

I am facing some problem in reading the status code from response. I am calling api in service, return this.http.get<string>( this.remoteServer + '/google.com/open', httpOptions); In my c...
Celestyna asked 26/6, 2018 at 19:0

1

Solved

I have a HTTP interceptor and before every request I check if the access token is expired, if it is, I subscribe to a http.post call from my service and then subscribe to it and when I get a new ac...

5

Solved

Which one is best to build a mock web service just for test purposes in Angular apps?
Lalonde asked 16/7, 2017 at 14:40

1

Solved

In my use case when the user clicks on the edit button, Angular makes an HTTP call to the backend and retrieves the object, then populates those values on EDIT form. The user can update or leave th...
Shoebill asked 13/4, 2019 at 5:53

0

I'm trying to proxy to a certain API endpoint that returns an html page but I get the error Access to font at 'https://data.domain.com/v3/assets/fonts/glyphicons-halflings-regular.woff2' from origi...
Wanderjahr asked 30/3, 2019 at 9:0

1

Solved

I'm trying to get the JSON using HttpClient in Angular 7. The code works fine but I'm trying to implement the commented lines to get the data directly from the API url and stop using the const IMAG...

1

Solved

I'm trying to unit test a few simple GET requests and no matter what I do, I can't get the tests to fail. If I change the ('GET') to ('POST') it will fail, but all of the api data passes no matter...
Boyla asked 21/1, 2019 at 18:6

2

Solved

I need to send a get request with body. Im using angular HttpClient. I understand that get method does not allow to send body, so i'm triyng the request method instead but i cant understand how to ...
Concave asked 15/1, 2019 at 10:24

1

Solved

I want to create an API helper class to serve for all types of rest api calls in the app. I have been using the angular httpClient class import {HttpClient} from '@angular/common/http' to do API...
Alyosha asked 2/1, 2019 at 8:5

1

Solved

I want to sand emails with angular 6 using an firebase function, but angular throws this error: error TS2305: Module '"E:/project/node_modules/@angular/common/http"' has no exported memb...
Amitie asked 30/12, 2018 at 18:43

5

I am calling an API that returns a JSON Object. I need just the value of the array to map to a Observable . If I call api that just returns the array my service call works. Below is my sample code...
Amyotonia asked 12/10, 2017 at 1:37

1

Solved

I'm trying to figure out how to best solve a race condition in my app in the simplest way possible. I have a route with two resolvers. The resolvers are: GetBooksResolver GetAuthorsResolver Now...
Centromere asked 11/12, 2018 at 4:7

1

Solved

I have a rest endpoint /Products/latest which returns 204 in case there are no products, and the following generic angular service: getFromAPI(url: string) { const params = new HttpParams(); r...
Inexperience asked 6/12, 2018 at 14:53

2

Solved

How to detect an error by timeout operator? I would like to show an alert or something like that just when the server doesn't response. I have a similiar code in my interceptor: this.http.post('h...
Nephogram asked 10/11, 2018 at 1:49

1

Solved

I've been having some trouble getting file download working in my application. To download the file I made a new call in the API I am using to get data into the application. I've tested this API us...
Chloramphenicol asked 26/11, 2018 at 14:52

3

Solved

Can I use promise within HttpInterceptor? For example: export class AuthInterceptor implements HttpInterceptor{ this.someService.someFunction() .then((data)=>{ //do something with data and th...

1

Solved

Angular 6 using HttpClient. No interceptors implemented for now. I have an admin service where I'm doing a http call to MSGraph. In this case I'm getting an error 400 bad request which I'm sending...
Rack asked 11/10, 2018 at 10:21

2

Solved

If I have code like the below: const d: any = {}; return this.http.post(url, body, httpOptions).map(data => { return d; }, error => { console.error('error'); }) .catch((err, d$) => { ...
Peppercorn asked 4/10, 2018 at 18:3

4

How can I modify my http call to handle(catch) for 500 server errors. I try calling an API but receive a '500 (Internal server error' in the 'err' part of the function. I would like to be able to c...
Environ asked 2/10, 2018 at 14:13

6

Solved

I am trying to make a POST call using HttpClient in an Angular 5 project, and I want to set the header: import { HttpClient, HttpHeaders, HttpRequest } from '@angular/common/http'; import { Inject...
Leopoldoleor asked 17/11, 2017 at 15:47

2

While using angular HttpClient of angular I got to know that HttpClient post method used cold observable and will make 2 separate calls to post data to the server.And also unless you will not subsc...
Irrelative asked 6/9, 2017 at 15:23

1

Solved

I have an existing call to Bing Maps made with Angular 4 Http service, that is working correctly: this.http.get("{absolute URL of Bing Maps REST Locations, with options and key}") I'm trying to ...
Carmeliacarmelina asked 27/7, 2018 at 14:58

© 2022 - 2024 — McMap. All rights reserved.