javascript - POST requests are being called twice in angular 2 -


i don't know post requests being called twice. may know fix this? tried using share() no avail.

the following code

 adduser(data): observable<user> {       let body : string = json.stringify(     {postdata: data}),     headers: = new headers({'content-type': 'application/json'}),     options: = new requestoptions({ headers: headers}),     url: = this.url+"/user/register";       return this.http.post(url,body,options).map(res=> <any>(res['_body']));   } 

enter image description here

first request type options, it's normal. http options method used describe communication options target resource.

read more here: https://developer.mozilla.org/en-us/docs/web/http/access_control_cors


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -