# Set HTTP status code in Web Dev module

**URL:** <https://forum.inductiveautomation.com/t/set-http-status-code-in-web-dev-module/58188>\
**Category:** Ignition\
**Created:** [April 7, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/set-http-status-code-in-web-dev-module/58188 "2022-04-07T19:09:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user69](https://avatars.discourse-cdn.com/v4/letter/u/58f4c7/32.png) [@user69](https://forum.inductiveautomation.com/u/user69)\
**Post date:** [April 7, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/set-http-status-code-in-web-dev-module/58188/1 "2022-04-07T19:09:14Z")

</div>

It is possible to have Web Dev endpoints return a status of 500 if the response dictionary doesn’t contain specific keys, or 404 if a desired file is not found. Is it possible to set the status arbitrarily in the do\* script itself? For instance if the Gateway is acting as an actual gateway, and the resource server responds with an error.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 7, 2022, 7:19pm UTC](https://forum.inductiveautomation.com/t/set-http-status-code-in-web-dev-module/58188/2 "2022-04-07T19:19:05Z")

</div>

See the note in the [docs](https://docs.inductiveautomation.com/pages/viewpage.action?pageId=72418276#WebDev-ReturnValue) regarding `request['servletResponse']`. That provides direct access to the [HttpServletResponse](https://javadoc.io/static/javax.servlet/javax.servlet-api/4.0.1/javax/servlet/http/HttpServletResponse.html), where you can do pretty much anything you need. Be sure to `return None` from the `doWhatever` method.
