Questions tagged [angular4-httpclient]

Use this tag only for questions related to the HttpClient service included in HttpClientModule of Angular version 4

The HttpClient service is included in HttpClientModule of Angular version 4. HttpClient can be used for establishing an HTTP communication performing requests and processing responses.

220 questions
6
votes
0 answers

how to have windows.location.href response act as a promise

I'm using implicit grant flow in angular 4 where the recommended approach is to set windows.location.href to the auth provider url. Can I create a promise from windows.location.href so I know to trigger a follow-up action once the promise…
Beaux
  • 139
  • 1
  • 9
6
votes
2 answers

ASP.NET Core 2.0 and Angular 4.3 File Upload with progress

Using the new Angular 4.3 HttpClient, how can I upload and access files in an ASP.NET Core 2.0 Controller while reporting upload progress to the client?
5
votes
1 answer

Adding custom headers to form submit

I am using angular 4 for one of my projects and i have a method which creates a form element dynamically and submits it postToUrl(path, params, method) { method = method || 'post'; let form = document.createElement('form'); …
5
votes
2 answers

Call another http api (without Intercepting) before actual http call is made in Angular's HttpInterceptor

I'm using HttpInterceptor api of Angular's HttpClientModule and now stuck with a situation. Here is my use-case. In my application, if any service makes an http call, I want to make another silent http call before it, and want to store it's result…
miiiii
  • 1,580
  • 1
  • 16
  • 29
5
votes
3 answers

Angular 4 HttpClient in Component Can't resolve all parameters

I started learning Angular 4 and got to the part with HTTP Client. Right now I'm trying to make an http call from the component (yes, I know I should transfer it to service, but still) But for some reason, when I try to inject HttpClient into my…
Nausik
  • 735
  • 8
  • 22
5
votes
0 answers

Angular 4.3 HttpClient Chunked Uploads

I have to deal with huge file uploads (over 4GB). Currently I am using the new HttpClient. Is it possible to set a option for chunked uploads in the new HttpClient Module in Angular 4.3? I found a solution for Angularjs with the ng-file-upload…
smedasn
  • 1,249
  • 1
  • 13
  • 16
5
votes
1 answer

Angular4 Interceptor change response

I have an auth HttpInterceptor: import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; import {AuthService} from '../service/auth.service'; import {Observable} from 'rxjs/Observable'; import…
4
votes
0 answers

How to send cookie in Request header in office JS task pane app? (Office-js Add-in with angular 4)

Sending cookie in request header (Office-js Add-in with angular 4) headers.append('Content-Type', 'application/json'); headers.append('Accept', 'application/json'); headers.append('App-Url',…
4
votes
2 answers

How to Refresh token in angular 5 using adal-angular5

I have an angular project(version 5.2), and using ADAL service(adal-angular5). After inactivity of 1 hour, user gets 401(unauthorized) from API response. To avoid this, i want to refresh token every time before calling API. I made an interceptor.…
Er Vipin Sharma
  • 2,519
  • 8
  • 22
  • 32
4
votes
0 answers

Angular 4 -> REST API Authentication using Self-Signed Certificate

The back-end Java REST API is using self signed certificate for API authentication, so that only authorized API calls can invoke the REST API. Assuming the server side is ready and client certificate is also produced, is there a way for Angular 4…
xzk
  • 827
  • 2
  • 18
  • 43
4
votes
4 answers

getting variable data outside subscribe method

I am trying to implement canActivate for user routes, before that I want to check whether the access token is still valid or not. Therefore I implement something like this export class AuthGuard implements CanActivate { data:Array; …
Ashish Jambhulkar
  • 1,374
  • 2
  • 14
  • 26
4
votes
3 answers

How to pass body through `httpclient` delete request in Angular5

How to pass body through httpClient in delete request? Please check my code. Is there any idea to pass data through body in delete request. There is no proper source how to call this request in angular 5. let body = removeFile; return…
4
votes
1 answer

Angular 4 http responses are mixed together

I am using Angular 4. This issue has been found in safari, chrome and Firefox. My Angular 4 application sends XHR Requests using httpclient to a REST service. Communication is in JSON. There's potential CORS issue so the browser sends a pre-flight…
user2808054
  • 1,376
  • 1
  • 11
  • 19
4
votes
1 answer

Angular 4 POST to MYSQL Database Using PHP

I've been searching for two weeks to find the answer to my question, which I feel should be relatively simple but I haven't been using the right keywords. I know Angular is front-end framework and I can use whatever database and backend I'd…
Curb
  • 57
  • 2
  • 7
4
votes
2 answers

How to converting Http to HttpClient in Angular 5 (or >4.3)?

I have a working code using Http and I would like to learn how to convert this to use the latest HttpClient. I have done the following steps: in App.module.ts: import { HttpClientModule } from "@angular/common/http"; add HttpClientModule into the…
Isak La Fleur
  • 4,428
  • 7
  • 34
  • 50
1
2
3
14 15