CORS with the API

This topic specifically discusses CORS (Cross Origin Resource Sharing). Additional information on working with proxies can be found in the proxies guide topic.

The has automatic detection for CORS. CORS allows web applications to bypass a browser's same origin policy and access resources or services on other servers/domains. When both the web server and the browser support CORS, a proxy is not required to do cross-domain requests. This is helpful as it can:

  • Provide a performance boost since the web application no longer has to send a request back to its server, wait for the server to access the desired resource, and interpret the result before sending it back to the client.
  • Simplify development as it is no longer necessary to maintain a proxy page on your server.

To support CORS, web servers must be pre-configured for it and browsers must be able to support it. For additional details on enabling this in a web server, please visit enable-cors.org.

CORS and WebGL

The renders layers using WebGL. WebGL requires access to the raw image data. The images must meet one of the following requirements:

  • Be on the same domain as the application, or
  • Be hosted on a server that supports CORS, or
  • Use a proxy.

Handling CORS in application workflow

Requests will always be made with the assumption that CORS is supported. If your server doesn't yet support CORS, you can enable a proxy rule.

Although the automatically assumes CORS support, we do recommend configuring a proxy if you are unsure about whether the services in your application are enabled for it. This proxy can be referenced within the application via the proxyUrl. By adding this, the application has a fallback mechanism in place in case the service request fails due to lack of CORS support.

Additional information

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close