# return custom http responses from a controller?

**URL:** <https://discuss.rubyonrails.org/t/return-custom-http-responses-from-a-controller/15114>\
**Category:** rubyonrails-talk\
**Created:** [June 30, 2007, 4:23am UTC](https://discuss.rubyonrails.org/t/return-custom-http-responses-from-a-controller/15114 "2007-06-30T04:23:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snacktime](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@snacktime](https://discuss.rubyonrails.org/u/snacktime)\
**Post date:** [June 30, 2007, 4:23am UTC](https://discuss.rubyonrails.org/t/return-custom-http-responses-from-a-controller/15114/1 "2007-06-30T04:23:50Z")

</div>

render is what supplies the response body. There are just more ways to render then you are aware of. render :text =\> 'test', render :file =\>file, render\_xml, etc..

To set headers do this before rendering:

headers["Content-Type"] = 'mycontenttype'

Chris
