My task is to link the registration form with api. I send the data with a post request, but the data is sent with an options request. As I suspect, the browser for security purposes prohibits cross-domain requests. How should I be in this situation? Should I still configure something in angular or is it a server issue?
export class HttpAddUserService { constructor(private http: Http) { } postData(obj: AddUser) { const body = JSON.stringify(obj); let headers = new Headers({ 'Content-Type': 'application/json' }); return this.http.post('http://.../api/adduser', body, { headers: headers }) .map((resp:Response)=>resp.json()) .catch((error:any) =>{return Observable.throw(error);}); } }