Skip to the content.

PUT

← Back to Home - To Transport


The PUT packet is used to append data to a bucket or modify existing data in a bucket.

Request

Put request bytemap

Figure A: PUT request byte-map (header and body)


The PUT request (see Figure A) includes a header. This header contains one field: the bucket id and is used to indicate which bucket is used.

The PUT packet accepts no extra flags.

The body contains an array with the following fields:

The indicated slot index will replace the data in the slot if it is already in use and you have write permissions. If you have append permissions and you try to write data to a slot that is not empty or is not the next empty slot in the bucket the server will send error code 51.

Response

PUT response bytemap

Figure B: PUT response byte-map


The PUT response is empty.

You might encounter the following error codes:

Process and flow

Put process

Figure C: PUT process flow


The PUT process (see Figure C) goes as follows:

  1. The client sends a PUT message containing the data and optionally containing a slot index
  2. The server checks if the user has permission to modify the bucket. If not, error code 3 is sent
  3. If the user has write permissions, put data to that slot (overwrite if slot is already in use)
  4. If the user has append permissions, only put data to that slot if slot is not already filled and is the first following empty slot in the bucket. If not the first following empty slot, return error 3. If the slot is already taken, return error 51.

← Back to Home - To Transport - Prev: CREATE packet - Next: APPEND packet