<!--
title: Use standard HTTP constants
domain: app-frameworks
topic: Networking
language: Go
source: gin-gonic/gin
updated: 2018-08-07
url: https://awesomereviewers.com/reviewers/gin-use-standard-http-constants/
-->

Always use the standard HTTP status constants from the `http` package instead of raw numeric values in your networking code. This practice improves code readability, maintainability, and helps prevent errors when working with HTTP responses.

For example, instead of:
```go
writer.WriteHeader(500)
c.AsciiJSON(204, []string{"lang", "Go语言"})
```

Use the semantic constants:
```go
writer.WriteHeader(http.StatusInternalServerError)
c.AsciiJSON(http.StatusNoContent, []string{"lang", "Go语言"})
```

This approach makes your code more descriptive and self-documenting. It also ensures consistency across the codebase and makes it easier for other developers to understand the HTTP status codes being used without having to memorize numeric values.
