Currently in the process of developing a website with Angular 5 and CouchDB. One of my methods in database.service.ts looks like this:
import {HttpClient} from '@angular/common/http';
const auth = my database adress;
constructor(private http: HttpClient) {}
createUser(id: string, email_: string, password: string, firstname: string, surname: string, role: string): any {
const obj: object = {
name: firstname, surname: surname_, role, email: email_, password: password_, theme: 'indigo', projects: {}, widgets: {}
};
return this.http.put(auth + '/' + id, JSON.parse(JSON.stringify(obj)))
.map((res: Response) => res);
}
When creating a user, the method is called like this:
this.databaseService.createUser(id, email, password, firstname, surname, this.role)
.subscribe(result => {},
err => {
console.log(err);
alert('No connection to database available!');
});
This functions correctly in Chrome, but not in Firefox. In Firefox, the PUT request does not execute at all, despite successful GET and POST requests. The headers appear correct ("Accept": 'application/json' etc..), leaving me puzzled as to what might be causing the issue.
Shouldn't it at least attempt execution? I appreciate any insights you may have on this matter.
Thank you for your assistance.