Step 6: POST data

We can now post the 2 sites to the server. Add a POST resource node. Links it first input port (port 0) to the Row Filter node we have added in Step 4 and the second input port (port 1) to the JSON representation of the Create REST Representation node from Step 5.

POST resource node added

When you open the dialog you will see that it is pretty similar to the one of the GET resource node. In fact, everything works the same way. There is only one additional section called Request Body Settings. Here you should tell the server which content type you are going to send (the selection of the Content Type drop down menu is added as Content-Type field with this value to the request header). You also have to select the name of the column containing the request representation. The referring table must contain exactly one row.

Set the Content Type to application/JSON and the select Representation as Representation Column.

POST resource node dialog

Execute the node. Again, the ouput tables and the views are working like in a GET resource node (see Step 1) except for the fact that we have 2 views here: one for the request body and one for the resource body. If everything has worked, the server has returned the status code 201 Created.

If you now reset and re-run the second GET resource node (the one from Step 4 - make sure to request ATOM) you will see that our collection has been extended. If you add and execute another Read REST representation node you will obtain the following data table:

Sites of the garden project after POST

What are you looking for?