-1

Every HTTP request is sent twice after refresh or return to Home Page but I call just one time my requests and components.

shiva
  • 1
  • 1
  • 1
    Could you be more specific? Show your code, what http requests you have and the types and responses, any errors and such. Could it be that where you are running the Angular app is different from where your http is requesting from? – Daniel H.J. Nov 01 '17 at 20:03

1 Answers1

0

Maybe is caused by CORS

This type of request is called Preflighted requests that corresponds to a negotiation between the caller and the Web application based on HTTP headers.

It consists of two phases:

  1. The browser executes an OPTIONS request with the same URL as the target request to check that it has the rights to execute the request. This OPTIONS request returns headers that identify what is possible to do for the URL.

  2. If rights match, the browser executes the request.

enter image description here

image taken from HERE

See my other answer

JuanDM
  • 1,250
  • 10
  • 24