← All blogs

dust blog

Post One JSON Body

Dust code snapshot showing a generated HTTP body call and a dust_server JSON body handler

Post one JSON body.

The client owns the request shape.

The generated HTTP client sends it with @Body().

The server reads the same shape with validBody.

Bad JSON shape returns 422.

Bad validation also returns 422.

The handler only runs after the body is decoded and validated.

Docs used: dust_server tutorial, dust_server extraction, and Dust HTTP bodies.

#Dust #DustServer #HTTPClient #Validation #Flutter