---
title: StatusCode
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.StatusCode/
---

**Kind:** Class  
**Module:** [http](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L14

Include `fastly/http/status_code.h` to use this class.

## Constructor

_Overload 1 of 2_

```cpp
fastly::http::StatusCode::StatusCode() = default
```

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L16

_Overload 2 of 2_

```cpp
constexpr constexpr fastly::http::StatusCode::StatusCode(uint16_t code)
```

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L19

Creates a new [StatusCode](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.StatusCode/). Panics if the code is out of range.

**Parameters**

- `code`: `uint16_t`

## Constants

### CONTINUE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L29

100 Continue [RFC9110, Section 15.2.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.2.1)

### SWITCHING_PROTOCOLS

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L33

101 Switching Protocols [RFC9110, Section 15.2.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.2.2)

### PROCESSING

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L37

102 Processing [RFC2518, Section 10.1](https://datatracker.ietf.org/doc/html/rfc2518#section-10.1)

### OK

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L41

200 OK [RFC9110, Section 15.3.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.1)

### CREATED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L45

201 Created [RFC9110, Section 15.3.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.2)

### ACCEPTED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L49

202 Accepted [RFC9110, Section 15.3.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.3)

### NON_AUTHORITATIVE_INFORMATION

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L53

203 Non-Authoritative Information [RFC9110, Section 15.3.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.4)

### NO_CONTENT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L57

204 No Content [RFC9110, Section 15.3.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.5)

### RESET_CONTENT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L61

205 Reset Content [RFC9110, Section 15.3.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.6)

### PARTIAL_CONTENT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L65

206 Partial Content [RFC9110, Section 15.3.7](https://datatracker.ietf.org/doc/html/rfc9110#section-15.3.7)

### MULTI_STATUS

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L69

207 Multi-Status [RFC4918, Section 11.1](https://datatracker.ietf.org/doc/html/rfc4918#section-11.1)

### ALREADY_REPORTED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L73

208 Already Reported [RFC5842, Section 7.1](https://datatracker.ietf.org/doc/html/rfc5842#section-7.1)

### IM_USED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L77

226 IM Used [RFC3229, Section 10.4.1](https://datatracker.ietf.org/doc/html/rfc3229#section-10.4.1)

### MULTIPLE_CHOICES

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L81

300 Multiple Choices [RFC9110, Section 15.4.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.1)

### MOVED_PERMANENTLY

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L85

301 Moved Permanently [RFC9110, Section 15.4.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.2)

### FOUND

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L89

302 Found [RFC9110, Section 15.4.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.3)

### SEE_OTHER

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L93

303 See Other [RFC9110, Section 15.4.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.4)

### NOT_MODIFIED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L97

304 Not Modified [RFC9110, Section 15.4.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.5)

### USE_PROXY

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L101

305 Use Proxy [RFC9110, Section 15.4.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.6)

### TEMPORARY_REDIRECT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L105

307 Temporary Redirect [RFC9110, Section 15.4.7](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.7)

### PERMANENT_REDIRECT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L109

308 Permanent Redirect [RFC9110, Section 15.4.8](https://datatracker.ietf.org/doc/html/rfc9110#section-15.4.8)

### BAD_REQUEST

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L113

400 Bad [Request](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.Request/) [RFC9110, Section 15.5.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.1)

### UNAUTHORIZED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L117

401 Unauthorized [RFC9110, Section 15.5.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.2)

### PAYMENT_REQUIRED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L121

402 Payment Required [RFC9110, Section 15.5.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.3)

### FORBIDDEN

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L125

403 Forbidden [RFC9110, Section 15.5.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.4)

### NOT_FOUND

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L129

404 Not Found [RFC9110, Section 15.5.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.5)

### METHOD_NOT_ALLOWED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L133

405 Method Not Allowed [RFC9110, Section 15.5.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.6)

### NOT_ACCEPTABLE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L137

406 Not Acceptable [RFC9110, Section 15.5.7](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.7)

### PROXY_AUTHENTICATION_REQUIRED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L141

407 Proxy Authentication Required [RFC9110, Section 15.5.8](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.8)

### REQUEST_TIMEOUT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L145

408 [Request](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.Request/) Timeout [RFC9110, Section 15.5.9](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.9)

### CONFLICT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L149

409 Conflict [RFC9110, Section 15.5.10](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.10)

### GONE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L153

410 Gone [RFC9110, Section 15.5.11](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.11)

### LENGTH_REQUIRED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L157

411 Length Required [RFC9110, Section 15.5.12](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.12)

### PRECONDITION_FAILED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L161

412 Precondition Failed [RFC9110, Section 15.5.13](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.13)

### PAYLOAD_TOO_LARGE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L165

413 Payload Too Large [RFC9110, Section 15.5.14](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.14)

### URI_TOO_LONG

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L169

414 URI Too Long [RFC9110, Section 15.5.15](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.15)

### UNSUPPORTED_MEDIA_TYPE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L173

415 Unsupported Media Type [RFC9110, Section 15.5.16](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.16)

### RANGE_NOT_SATISFIABLE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L177

416 Range Not Satisfiable [RFC9110, Section 15.5.17](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.17)

### EXPECTATION_FAILED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L181

417 Expectation Failed [RFC9110, Section 15.5.18](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.18)

### IM_A_TEAPOT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L185

418 I'm a teapot [curiously not registered by IANA but [RFC2324, Section 2.3.2](https://datatracker.ietf.org/doc/html/rfc2324#section-2.3.2)]

### MISDIRECTED_REQUEST

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L189

421 Misdirected [Request](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.Request/) [RFC9110, Section 15.5.20](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.20)

### UNPROCESSABLE_ENTITY

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L193

422 Unprocessable Entity [RFC9110, Section 15.5.21](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.21)

### LOCKED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L197

423 Locked [RFC4918, Section 11.3](https://datatracker.ietf.org/doc/html/rfc4918#section-11.3)

### FAILED_DEPENDENCY

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L201

424 Failed Dependency [RFC4918, Section 11.4](https://tools.ietf.org/html/rfc4918#section-11.4)

### TOO_EARLY

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L204

425 Too early [RFC8470, Section 5.2](https://httpwg.org/specs/rfc8470.html#status)

### UPGRADE_REQUIRED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L208

426 Upgrade Required [RFC9110, Section 15.5.22](https://datatracker.ietf.org/doc/html/rfc9110#section-15.5.22)

### PRECONDITION_REQUIRED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L212

428 Precondition Required [RFC6585, Section 3](https://datatracker.ietf.org/doc/html/rfc6585#section-3)

### TOO_MANY_REQUESTS

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L216

429 Too Many Requests [RFC6585, Section 4](https://datatracker.ietf.org/doc/html/rfc6585#section-4)

### REQUEST_HEADER_FIELDS_TOO_LARGE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L220

431 [Request](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.Request/) Header Fields Too Large [RFC6585, Section 5](https://datatracker.ietf.org/doc/html/rfc6585#section-5)

### UNAVAILABLE_FOR_LEGAL_REASONS

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L223

451 Unavailable For Legal Reasons [RFC7725, Section 3](https://tools.ietf.org/html/rfc7725#section-3)

### INTERNAL_SERVER_ERROR

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L227

500 Internal Server Error [RFC9110, Section 15.6.1](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.1)

### NOT_IMPLEMENTED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L231

501 Not Implemented [RFC9110, Section 15.6.2](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.2)

### BAD_GATEWAY

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L235

502 Bad Gateway [RFC9110, Section 15.6.3](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.3)

### SERVICE_UNAVAILABLE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L239

503 Service Unavailable [RFC9110, Section 15.6.4](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.4)

### GATEWAY_TIMEOUT

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L243

504 Gateway Timeout [RFC9110, Section 15.6.5](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.5)

### HTTP_VERSION_NOT_SUPPORTED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L247

505 HTTP Version Not Supported [RFC9110, Section 15.6.6](https://datatracker.ietf.org/doc/html/rfc9110#section-15.6.6)

### VARIANT_ALSO_NEGOTIATES

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L251

506 Variant Also Negotiates [RFC2295, Section 8.1](https://datatracker.ietf.org/doc/html/rfc2295#section-8.1)

### INSUFFICIENT_STORAGE

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L255

507 Insufficient Storage [RFC4918, Section 11.5](https://datatracker.ietf.org/doc/html/rfc4918#section-11.5)

### LOOP_DETECTED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L259

508 Loop Detected [RFC5842, Section 7.2](https://datatracker.ietf.org/doc/html/rfc5842#section-7.2)

### NOT_EXTENDED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L263

510 Not Extended [RFC2774, Section 7](https://datatracker.ietf.org/doc/html/rfc2774#section-7)

### NETWORK_AUTHENTICATION_REQUIRED

**Type:** `const StatusCode`  
**Flags:** read-only  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L267

511 Network Authentication Required [RFC6585, Section 6](https://datatracker.ietf.org/doc/html/rfc6585#section-6)

## Methods

### as_code

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L282

```cpp
uint16_t fastly::http::StatusCode::as_code()
```

Returns the `uint16_t` corresponding to this [`StatusCode`](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/http/class.StatusCode/).

**Returns**

`uint16_t`

### canonical_reason

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L303

```cpp
tl::expected<std::optional<std::string>, fastly::FastlyError> fastly::http::StatusCode::canonical_reason()
```

Get the standardised `reason-phrase` for this status code.

This is mostly here for servers writing responses, but could potentially have application at other times.

The reason phrase is defined as being exclusively for human readers. You should avoid deriving any meaning from it at all costs.

Bear in mind also that in HTTP/2.0 and HTTP/3.0 the reason phrase is abolished from transmission, and so this canonical reason phrase really is the only reason phrase you’ll find.

###### Example

**Returns**

`tl::expected<std::optional<std::string>, fastly::FastlyError>`

```cpp
auto status{fastly::http::StatusCode::OK};
assert(status.canonical_reason() == std::optional("OK"s)));
```

### from_code

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L279

```cpp
std::optional<StatusCode> fastly::http::StatusCode::from_code(uint16_t code)
```

Converts a uint16_t to a status code, returning it wrapped in an `std::optional`.

The method validates the correctness of the supplied uint16_t. It must be greater or equal to 100 and less than 1000, or this method will return `std::nullopt`.

**Parameters**

- `code`: `uint16_t`

**Returns**

`std::optional<StatusCode>`

### is_client_error

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L315

```cpp
bool fastly::http::StatusCode::is_client_error()
```

Check if status is within 400-499.

**Returns**

`bool`

### is_informational

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L306

```cpp
bool fastly::http::StatusCode::is_informational()
```

Check if status is within 100-199.

**Returns**

`bool`

### is_redirection

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L312

```cpp
bool fastly::http::StatusCode::is_redirection()
```

Check if status is within 300-399.

**Returns**

`bool`

### is_server_error

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L318

```cpp
bool fastly::http::StatusCode::is_server_error()
```

Check if status is within 500-599.

**Returns**

`bool`

### is_success

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L309

```cpp
bool fastly::http::StatusCode::is_success()
```

Check if status is within 200-299.

**Returns**

`bool`

### operator bool

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L271

```cpp
explicit fastly::http::StatusCode::operator bool() const = delete
```

### operator!=

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L270

```cpp
constexpr constexpr bool fastly::http::StatusCode::operator!=(StatusCode a) const
```

**Parameters**

- `a`: `StatusCode`

**Returns**

`constexpr bool`

### operator==

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/http/status_code.h#L269

```cpp
constexpr constexpr bool fastly::http::StatusCode::operator==(StatusCode a) const
```

**Parameters**

- `a`: `StatusCode`

**Returns**

`constexpr bool`
