Topic: How to set Authorization header in Autocomplete remote method?
I want to use Autocomplete with remote Data. My Server using Authentication so I have to send "Authorization: Bearer {token}" so how i can add this header before sending the Autocomplete request to server?
Damian Gemza staff answered 6 years ago
Dear @onlinist
There's requestOptions in which you can set the request options including the headers
this.dataRemote = completerService.remote(
"http://server.example.com?",
"name",
"name");
let options = new RequestOptions({headers: new Headers()});
options.headers.set("Authorization", token);
this.dataRemote. requestOptions(options);
Best Regards,
Damian
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 7.0.0
- Device: All
- Browser: All
- OS: All
- Provided sample code: No
- Provided link: No