# Request header field kbn-version is not allowed by Access-Control-Allow-Headers in preflight response Errror when doing Rest Call in Kibana Plugin

**URL:** <https://discuss.elastic.co/t/request-header-field-kbn-version-is-not-allowed-by-access-control-allow-headers-in-preflight-response-errror-when-doing-rest-call-in-kibana-plugin/44824>\
**Category:** Kibana\
**Created:** [March 18, 2016, 9:45am UTC](https://discuss.elastic.co/t/request-header-field-kbn-version-is-not-allowed-by-access-control-allow-headers-in-preflight-response-errror-when-doing-rest-call-in-kibana-plugin/44824 "2016-03-18T09:45:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksuperman](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@ksuperman](https://discuss.elastic.co/u/ksuperman)\
**Post date:** [March 18, 2016, 9:45am UTC](https://discuss.elastic.co/t/request-header-field-kbn-version-is-not-allowed-by-access-control-allow-headers-in-preflight-response-errror-when-doing-rest-call-in-kibana-plugin/44824/1 "2016-03-18T09:45:54Z")

</div>

Hello all,  
I have a problem when making a rest API Call to external URL inside a custom visualization plugin, where i keep getting this error.

I have CORS enabled on the Node server where this call is being directed.

Any help resolving this would be appreciated. Also if there is another way of making rest call in Kibana Plugin Please let me know of that as well.

**Error In Chrome Console**

## \> XMLHttpRequest cannot load [http://localhost:3000/test](http://localhost:3000/test). Request header field kbn-version is not allowed by Access-Control-Allow-Headers in preflight response.

**Code Causing this Issue.**

```
var data = $.param({
              fName: $scope.firstName,
              lName: $scope.lastName
          });
          var config = {
                headers : {
                    'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
                }
            }
            $http.post('http://localhost:3000/test', data, config)
            .success(function (data, status, headers, config) {
               console.log(data);
            })
            .error(function (data, status, header, config) {
               console.log("Error!!!");
                 console.log(data);
            });
```

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [March 25, 2016, 12:58am UTC](https://discuss.elastic.co/t/request-header-field-kbn-version-is-not-allowed-by-access-control-allow-headers-in-preflight-response-errror-when-doing-rest-call-in-kibana-plugin/44824/2 "2016-03-25T00:58:12Z")

</div>

Is this still happening? If so, you might consider jumping on IRC during North America business hours to chat with Kibana devs live about troubleshooting this. There are some plugin development resources here, and as you see IRC is the best way to get help: [https://github.com/elastic/kibana/wiki/Plugin-Resources](https://github.com/elastic/kibana/wiki/Plugin-Resources)

---

<div class="post-metadata">

**Author:** ![Veer\_Shubhranshu\_Shr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/veer_shubhranshu_shr/32/9530_2.png) [@Veer\_Shubhranshu\_Shr](https://discuss.elastic.co/u/Veer_Shubhranshu_Shr)\
**Post date:** [May 11, 2016, 4:45am UTC](https://discuss.elastic.co/t/request-header-field-kbn-version-is-not-allowed-by-access-control-allow-headers-in-preflight-response-errror-when-doing-rest-call-in-kibana-plugin/44824/3 "2016-05-11T04:45:54Z")

</div>

Hi Tanya,

I am also facing the same issue. Did the team find any fix for the issue?

---

<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:** [July 6, 2017, 1:53pm UTC](https://discuss.elastic.co/t/request-header-field-kbn-version-is-not-allowed-by-access-control-allow-headers-in-preflight-response-errror-when-doing-rest-call-in-kibana-plugin/44824/4 "2017-07-06T13:53:41Z")

</div>


