# Intercept specific Request/Response

**URL:** <https://discuss.elastic.co/t/intercept-specific-request-response/243829>\
**Category:** Kibana\
**Created:** [August 5, 2020, 8:57am UTC](https://discuss.elastic.co/t/intercept-specific-request-response/243829 "2020-08-05T08:57:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![koyassan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/koyassan/32/48847_2.png) [@koyassan](https://discuss.elastic.co/u/koyassan)\
**Post date:** [August 5, 2020, 8:57am UTC](https://discuss.elastic.co/t/intercept-specific-request-response/243829/1 "2020-08-05T08:57:58Z")

</div>

Hi guys,

I'm trying to develop a plugin that intercept some specific requests, such as `/some/api/request`. My main goal is intercept the payload and the response of that request. I'm thinking about add these script in some `hack.js` file.  
I take a brief look into `KFetch`, but it seems that is an alternative to `$http`, so it's no what I want...  
Another thing that I've found on the Documentation it's the [HttpInterceptor](https://github.com/elastic/kibana/blob/master/docs/development/core/public/kibana-plugin-core-public.httpinterceptor.md) with the `request` and `response` methods.

But I don't know how to implement them... 😅  
Can you help me guys?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [August 12, 2020, 1:44pm UTC](https://discuss.elastic.co/t/intercept-specific-request-response/243829/2 "2020-08-12T13:44:20Z")

</div>

What version of Kibana are you targeting? Are you trying to capture request/responses in the client or the server?

Can you describe your use case? What is your plugin trying to do?

Starting in Kibana 7.9, all plugins have migrated over to the new kibana platform. In this new platform, Kfetch and $http have been replaced with [http service](https://github.com/elastic/kibana/tree/7.9/src/core/public/http) which is provided to plugins via core parameter in the start method.

---

<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:** [September 9, 2020, 1:44pm UTC](https://discuss.elastic.co/t/intercept-specific-request-response/243829/3 "2020-09-09T13:44:24Z")

</div>

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