# CORS

You can enable CORS for you endpoint by responding with the correct headers, as well as potentially adding an OPTIONS handler for your endpoint.

The example below pretty much allows any origin to connect to our API.

<figure><img src="/files/OhjQibpNj91GPEHf3VTd" alt=""><figcaption></figcaption></figure>

To replicate, you can paste the json data below directly into the editor.

```
{
  "Access-Control-Allow-Origin": "*",
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
  "Access-Control-Allow-Headers": "Content-Type, Authorization"
}
```

Make sure you also respond with those headers in the actual handler:

<figure><img src="/files/LxQCwkSiTq2177fTXMFx" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.midio.com/midio-docs/guides/http/cors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
