# HttpNoBodyStatus

> Defines HTTP status codes that do not allow a response body.

[API reference](/docs/api/index.md) › [PSR bridge](/docs/extensions/psr-bridge/reference/index.md) › [emitter](/docs/extensions/psr-bridge/reference/emitter/index.md) › HttpNoBodyStatus

| enum | `yii2\extensions\psrbridge\emitter\HttpNoBodyStatus` |
| --- | --- |
| Backed by | `int` |
| Source | [`src/emitter/HttpNoBodyStatus.php`](https://github.com/yii2-extensions/psr-bridge/blob/main/src/emitter/HttpNoBodyStatus.php#L12) |

Defines HTTP status codes that do not allow a response body.

See also: <https://datatracker.ietf.org/doc/html/rfc7231> (RFC 7231.).

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-CONTINUE"></span>`CONTINUE` | `100` | '100' Continue. |
| <span id="case-EARLY_HINTS"></span>`EARLY_HINTS` | `103` | '103' Early Hints. |
| <span id="case-NO_CONTENT"></span>`NO_CONTENT` | `204` | '204' No Content. |
| <span id="case-NOT_MODIFIED"></span>`NOT_MODIFIED` | `304` | '304' Not Modified. |
| <span id="case-PROCESSING"></span>`PROCESSING` | `102` | '102' Processing (WebDAV). |
| <span id="case-RESET_CONTENT"></span>`RESET_CONTENT` | `205` | '205' Reset Content. |
| <span id="case-SWITCHING_PROTOCOLS"></span>`SWITCHING_PROTOCOLS` | `101` | '101' Switching Protocols. |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`shouldHaveNoBody()`](#method-shouldHaveNoBody) static | Returns whether the status code should not include a body. | `HttpNoBodyStatus` |

## Method details

### shouldHaveNoBody() <span id="method-shouldHaveNoBody"></span>

```php
public static function shouldHaveNoBody(int $statusCode): bool
```

Returns whether the status code should not include a body.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$statusCode` | `int` | HTTP status code to check. |

**Returns**

`bool`: `true` when the status code must not carry a body; `false` otherwise.