# WebDev- How can I respond HTTP code 204

**URL:** <https://forum.inductiveautomation.com/t/webdev-how-can-i-respond-http-code-204/30338>\
**Category:** Ignition\
**Created:** [November 30, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/webdev-how-can-i-respond-http-code-204/30338 "2019-11-30T16:05:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [November 30, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/webdev-how-can-i-respond-http-code-204/30338/1 "2019-11-30T16:05:54Z")

</div>

Hello everyone,  
Using WebDev, I’ve to respond to a callback and the server accept only a code 204 No Content as a response. It seems that webdev answer 200 by default if there is nothing return.  
How can I do that?  
Many thanks

---

<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:** [December 1, 2019, 6:56pm UTC](https://forum.inductiveautomation.com/t/webdev-how-can-i-respond-http-code-204/30338/2 "2019-12-01T18:56:12Z")

</div>

You should be able to do it directly with the servletResponse from the request, hinted at [in the manual](https://docs.inductiveautomation.com/display/DOC79/Web+Dev#WebDev-RequestParameter). You must return `None` to prevent normal handling of a webdev dictionary response.

Something like this:

```auto
    response = request['servletResponse']
    response.status = 204
    return None

```

---

<div class="post-metadata">

**Author:** ![gnguyen](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@gnguyen](https://forum.inductiveautomation.com/u/gnguyen)\
**Post date:** [December 2, 2019, 6:04am UTC](https://forum.inductiveautomation.com/t/webdev-how-can-i-respond-http-code-204/30338/3 "2019-12-02T06:04:26Z")

</div>

Hi,

Thanks, that’s perfect.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 6, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/webdev-how-can-i-respond-http-code-204/30338/4 "2025-01-06T13:01:28Z")

</div>

For those encountering this post in 2025, like I am now:  
It seems returning a dict does work.

Here I changed the code to 302 and returned a dict:

> **endpoint's code for reference**
>
> ```python
> def doGet(request, session):
> tag_paths = [
> "[System]Gateway/Redundancy/IsMaster",
> "[System]Gateway/Redundancy/IsActive"
> ]
> is_master, is_active = [qv.value for qv in system.tag.readBlocking(tag_paths)]
> 	
> if not is_active:
> request['servletResponse'].status = 302
> 	
> return {
> 'json': {
> 'is_master': is_master,
> 'ip_addr': system.net.getIpAddress(),
> 'hostname': system.net.getHostName()
> }
> }
> 
> ```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/aed9bc89c3cd3fae881ec5f2341104b60b224ada.png)
