Cors Issue when using rest api

My restapi is working fine in postman, but when I am trying in localhost it is throwing me error of cors.

In the above link post one of them said to try simple endpoints first. /api/method/ping or /api/method/version , it they work CORS work.

The above both the end points is also working fine in my localhost but with the other thing it is throwing me error while same is working fine in postman

Use allow_cors option in site config file

https://frappeframework.com/docs/v13/user/en/basics/site_config#optional-settings-2

Yes I have already enabled that, and the simple endpoints is working fine in localhost