# How to read Request and Response using Lua Plugin

**URL:** <https://discourse.haproxy.org/t/how-to-read-request-and-response-using-lua-plugin/8484>\
**Category:** Help!\
**Created:** [March 9, 2023, 9:56am UTC](https://discourse.haproxy.org/t/how-to-read-request-and-response-using-lua-plugin/8484 "2023-03-09T09:56:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartik-v](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kartik-v](https://discourse.haproxy.org/u/kartik-v)\
**Post date:** [March 9, 2023, 9:56am UTC](https://discourse.haproxy.org/t/how-to-read-request-and-response-using-lua-plugin/8484/1 "2023-03-09T09:56:23Z")

</div>

We have a usecase where we need to read request and response for API calls being proxied via HAProxy. We tried and we could only have read http request body, and not response. Any documentation that can help us ?

---

<div class="post-metadata">

**Author:** ![simplexion](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/simplexion/32/1858_2.png) [@simplexion](https://discourse.haproxy.org/u/simplexion)\
**Post date:** [March 10, 2023, 11:59pm UTC](https://discourse.haproxy.org/t/how-to-read-request-and-response-using-lua-plugin/8484/2 "2023-03-10T23:59:40Z")

</div>

> **[API | Lua | Lua scripts | HAProxy Enterprise 2.7r1](https://www.haproxy.com/documentation/hapee/latest/api/lua/scripts/)**
>
> Getting started with Lua scripts on HAProxy Enterprise.
