Linked Questions
47 questions linked to/from Angular - Set headers for every request
54
votes
6
answers
182k
views
How to correctly set Http Request Header in Angular 2
I have an Ionic 2 application using Angular 2, which is sending an Http PUT to a ASP.NET Core API server. Here's the method I'm using to send the request:
public update(student: Student): Promise<...
59
votes
10
answers
47k
views
What is httpinterceptor equivalent in angular2?
In angularjs, we have http interceptor
$httpProvider.interceptors.push('myHttpInterceptor');
with which we can hook into all http calls, and show or hide loading bars, do logging, etc..
What is the ...
44
votes
4
answers
37k
views
Django with Angular 2
I want to integrate Angular 2 with Django and I have some questions to make.
How can I change the interpolation syntax for Angular 2 from {{ }} to (( )) or something like this?
How can I add the CSRF ...
59
votes
7
answers
257k
views
http post - how to send Authorization header?
How do you add headers to your http request in Angular2 RC6?
I got following code:
login(login: String, password: String): Observable<boolean> {
console.log(login);
console.log(password)...
43
votes
4
answers
99k
views
How do you POST a FormData object in Angular 2?
I need to upload a file and send some json along with it, I have this function:
POST_formData(url, data) {
var headers = new Headers(), authtoken = localStorage.getItem('authtoken');
...
33
votes
3
answers
68k
views
Angular 6 HTTP Get request with HTTP-Basic authentication
I`m trying to access a URL with Basic Authentication.
The URL returns JSON data.
How can I add my username and password to this http request below?
private postsURL = "https://jsonExample/posts";
...
8
votes
3
answers
29k
views
How do I add a json web token to each header?
So I am trying to use JSON web tokens for authentication and am struggling trying to figure out how to attach them to a header and send them on a request.
I was trying to use https://github.com/auth0/...
3
votes
5
answers
23k
views
Angular 2/4 how to add multiple headers to http post
I've problem with adding additonal headers to html post.
with curl works very well like with postman.
I can't add Authorization header to post request.
my problem is similar to https://stackoverflow....
6
votes
3
answers
34k
views
Argument of type '{header:Header;}' is not assignable to parameter of type 'RequestOptionsArgs'
Im Getting following error while trying to pass header in HTTP.POST/GET request Argument of type '{header:Header;}' is not assignable to parameter of type 'RequestOptionsArgs'. Property 'null' is ...
8
votes
1
answer
9k
views
How do you set global custom headers in Angular2?
I want to set the header Content-type: application/json in all my requests to my backend in Angular2. I use this in my main app.js file.
let headers = new Headers({
'Content-Type', 'application/...
6
votes
1
answer
12k
views
Angular2 http.post and undefined req.body
I have a problem with receiving json from http.post. Let's make it clear a bit:
This is my component file:
import {Component} from 'angular2/core'
import {Http, HTTP_PROVIDERS, Headers} from '...
3
votes
2
answers
4k
views
Angular2 http default headers common Authorization tokens
In angular 1, I was able to manipulate the http object so the request header for a post included authentication like this:
$http.defaults.headers.common['Authorization'] = "Token " + sessionobject....
0
votes
2
answers
10k
views
How to implement user's info inside JWT token in spring-boot?
Good moorning everyone !
I'm working on a project with spring boot (JWT & Spring security ) and Angular5 in front-End .
I'm now in a phase where i need to send the authenticated user's ID with the ...
5
votes
2
answers
10k
views
How to call REST service with Basic Authentication in Angularjs 2.0?
I have java REST services and consumer in Angularjs 1.3. Services are JSON based and expect BASIC authentication (username-password).
In AgJs 1.3, I used Base64 factory code (found on google) for ...
5
votes
1
answer
12k
views
Update a formControl that is a file input in a formArray in Angular2
I have the code below:
import { Component, OnInit, ElementRef } from '@angular/core';
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
@Component({
...