Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setAlert(params: SetAlertParams) {
- return this.http.get<{user: string, password: string}>(urls.getCredentials).pipe(
- switchMap(credentials => {
- const headers = new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authentication': `Basic ${btoa(`${credentials.user}${credentials.password}`)}`
- });
- const formData = new FormData();
- Object.keys(params).forEach(key => formData.append(key, params[key]));
- return this.http.post<SetAlertResult>(urls.setAlert, formData, {
- headers: headers,
- withCredentials: true
- });
- }
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement