HTTP
Table of Contents
Introduction
DiceDB supports HTTP protocol for clients to connect to the database. This allows clients to connect to DiceDB over the web stack, enabling frontends to have direct access to DiceDB, which is currently not possible with Redis.
API Endpoint
All requests should be sent to the base URL of your server, followed by the command name:
General Request Structure
- HTTP Method: POST for all operations
- Path: The DiceDB command name (e.g.,
/GET
,/SET
,/HGET
) - Headers:
Content-Type: application/json
- Body: JSON object containing command arguments
Query Parameters
Certain commands may require additional query parameters. For example:
key_prefix
: Used for theJSON.INGEST
command to specify a key prefix
These will be specified in the command documentation.
Supported Commands
Our HTTP API supports all DiceDB commands. Please refer to our comprehensive command reference for each command, commands which lack support will be flagged as such.
Examples
Setting a Key-Value Pair
Request:
Response:
Getting a Value
Request:
Response:
Setting a field in Hash
Request:
Response:
Getting a field in a HashSet
Request:
Response: