Skip to main content
Prefer closing the connection from the client in new code, which avoids leaving TIME_WAIT sockets on the server.
Use QUIT to ask the server to close the connection once all pending replies have been sent. The server replies OK and then terminates the connection, so no reply is lost and the shutdown is clean from both sides. Modern clients usually just close the socket, and pooled connections should be returned to the pool rather than closed, so QUIT is mostly useful in scripts and interactive sessions.

Syntax

Arguments

This command takes no arguments.

Important points

  • This is a connection-oriented command and is available over native Redis TCP, not the stateless REST endpoint.

Response

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.