Placing data on the I2E Server: POST or PUT?
Linguamatics
The past few weeks have been busy: we’re fresh from our Text Mining Summit, which included a dedicated training session for users who wished to develop against the I2E Web Services API.
I also had the opportunity to go on site to a customer to provide some focused API training.
These sessions generated lots of interesting questions about automating processes from an administration perspective as well as a user perspective.
As I was presenting some high-level slides during the Text Mining Summit, I noted that I was mixing up put and post (and sometimes place and push!) in a way that is forgivable when using them as English verbs, but unhelpful when trying to explain a RESTful Web Service.
So after the Summit, I went back to our Developers Guide and back to my notes and started over, to create a helpful explanation of when you POST and when you PUT to the I2E Server.
Both PUT and POST are methods to transfer data to the server and there are some use cases when they can be used interchangeably.
One example of that is creating a new file called newfile.txt in the Source Data collection on the I2E server:
PUT url=http://i2eserver:8334/api;type=data/newfile.txt data=filecontent
POST url=http://i2eserver:8334/api;type=data/?base=newfile.txt data=filecontent
The end result will be the same in either case, but as you can see from the URL, the resource name is set differently: