# Setting response headers in the yml

**URL:** <https://forum.serverless.com/t/setting-response-headers-in-the-yml/15611>\
**Category:** Serverless Framework\
**Created:** [July 22, 2021, 7:42pm UTC](https://forum.serverless.com/t/setting-response-headers-in-the-yml/15611 "2021-07-22T19:42:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreasp123](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/andreasp123/32/6017_2.png) [@Andreasp123](https://forum.serverless.com/u/Andreasp123)\
**Post date:** [July 22, 2021, 7:42pm UTC](https://forum.serverless.com/t/setting-response-headers-in-the-yml/15611/1 "2021-07-22T19:42:49Z")

</div>

Hi,

I’m following the documentation in order to set response headers. I’m doing so because CORS is killing me and my spirit.

Anyways, the docs ([https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#responses](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#responses)) says I can do it like this:

```auto
    events:
      - http:
          method: get
          path: whatever
          response:
            headers:
              Content-Type: "'text/html'"

```

However, it seems like the docs aren’t up to date because serverless is complaining when deploying, `Serverless: Configuration warning at 'functions.login.events[1].httpApi': unrecognized property 'response'`

How do you set response headers in the newest version?

Thanks!
