This topic describes the PUT command in VMware Tanzu GemFire to update or insert data for a key in a region.
http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}/{key}
See PUT /gemfire-api/v1/{region}/{key}?op=REPLACE and PUT /gemfire-api/v1/{region}/{key}?op=CAS.
PUT /gemfire-api/v1/orders/2
Request Payload: application/json
Content-Type: application/json
Accept: application/json
{
"@type": "org.apache.geode.web.rest.domain.Order",
"purchaseOrderNo": 1121,
"customerId": 1012,
"description": "Order for XYZ Corp",
"orderDate": "02/10/2020",
"deliveryDate": "02/20/2020",
"contact": "Pie Doe",
"email": "[email protected]",
"phone": "01-2048096",
"totalPrice": 225,
"items": [
{
"itemNo": 1,
"description": "Product-100",
"quantity": 10,
"unitPrice": 5,
"totalPrice": 50
}
]
}
Response Payload: null
200 OK
Status Code | Description |
---|---|
400 BAD REQUEST | Returned if supplied key is an invalid format. |
404 NOT FOUND | Returned if the region is not found. |
500 INTERNAL SERVER ERROR | Error encountered at Tanzu GemFire server. Check the HTTP response body for a stack trace of the exception. |
This operation is idempotent, meaning multiple identical requests should have the same effect as the initial request.