# Unable to execute POST request to Kibana

**URL:** <https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992>\
**Category:** Kibana\
**Created:** [August 22, 2020, 4:54pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992 "2020-08-22T16:54:10Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![peternijem](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@peternijem](https://discuss.elastic.co/u/peternijem)\
**Post date:** [September 1, 2020, 1:41pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/21 "2020-09-01T13:41:13Z")

</div>

I've updated my kibana.yml according to your suggestion:  
`server.cors: true`  
server.xsrf.disableProtections: true

I am still getting the same error:  
`app:1 Access to XMLHttpRequest at 'http://10.100.0.207:5604/api/features' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource`

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 1, 2020, 1:42pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/22 "2020-09-01T13:42:51Z")

</div>

Give me a bit to get an installation of 7.5.1 running, and I'll try to reproduce this locally

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 1, 2020, 1:53pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/23 "2020-09-01T13:53:44Z")

</div>

I'm not able to reproduce this error when configured with

```auto
server.cors: true
server.xsrf.disableProtection: true

```

When I don't have these set, then I do see the errors you're reporting, but that's expected.

Are you restarting your Kibana server after making these configuration changes?

---

<div class="post-metadata">

**Author:** ![peternijem](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@peternijem](https://discuss.elastic.co/u/peternijem)\
**Post date:** [September 2, 2020, 5:44am UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/24 "2020-09-02T05:44:05Z")

</div>

How have you executed the GET request?  
Using cURL or Postman will work

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 2, 2020, 5:37pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/25 "2020-09-02T17:37:54Z")

</div>

Good question. I tested using both a GET and POST request in the browser

---

<div class="post-metadata">

**Author:** ![peternijem](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@peternijem](https://discuss.elastic.co/u/peternijem)\
**Post date:** [September 2, 2020, 8:53pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/26 "2020-09-02T20:53:11Z")

</div>

You mean you have entered the route and executed that from the browser? or you mean you've executed GET and POST request from an external app which is loaded in the browser?  
My case is the second one. The first case will obviously work.  
Typing localhost:5601/api/spaces/space in the browser address bar, will result in sending a GET request to this endpoint which will return the existing spaces.

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 3, 2020, 4:21pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/27 "2020-09-03T16:21:37Z")

</div>

I did the latter:

I opened Kibana in one tab to ensure I was logged in, then opened another tab and loaded google.  
I don't have another external app laying around, so I simulated this with Google by using `fetch` from the browser dev tools to access my Kibana APIs. This guaranteed a cross-origin request, and I could see the browser send the preflight `OPTIONS` request to ensure the request would be allowed before proceeding.

Without the configuration changes, I was seeing the CORS errors using this method. After adjusting my Kibana config, the errors went away, and I was able to hit those endpoints without any issues.

---

<div class="post-metadata">

**Author:** ![peternijem](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@peternijem](https://discuss.elastic.co/u/peternijem)\
**Post date:** [September 4, 2020, 7:34am UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/28 "2020-09-04T07:34:29Z")

</div>

OK thanks Larry. I will try to do the same scenario you've done. I will share my results.

Is there any API to retrieve kibana.yml configurations or check specific peroperty's value in it?  
I am suspecting then that my Kibana is not reading those configurations from my yml (although it does for other configurations)

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 8, 2020, 4:00pm UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/29 "2020-09-08T16:00:55Z")

</div>

> [@peternijem](#):
>
> Is there any API to retrieve kibana.yml configurations or check specific peroperty's value in it?

Unfortunately there is not. The yml file can contain sensitive information, which we wouldn't want to expose over an API, even an authenticated one.

Sorry if this is an obvious suggestion, but did you ensure that your settings aren't prefix with a `#`?

So instead of

```yml
# server.cors: true

```

You would want:

```yml
server.cors: true

```

---

<div class="post-metadata">

**Author:** ![peternijem](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@peternijem](https://discuss.elastic.co/u/peternijem)\
**Post date:** [September 13, 2020, 7:29am UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/30 "2020-09-13T07:29:12Z")

</div>

Hi @Larry_Gregory

Can you please attach the steps you've done?  
I want to have identical steps.  
In the meanwhile, I've developed server-side for my app and from there I can execute any request to Kibana.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 11, 2020, 7:29am UTC](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992/31 "2020-10-11T07:29:14Z")

</div>

Closed on October 11, 2020, 7:29am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

[Previous page](https://discuss.elastic.co/t/unable-to-execute-post-request-to-kibana/245992.md?page=1)
