I do kind of agree to you. (At first glance). To illustrate this better i would like to point out two primary differences between POST and PUT request first.
-
By API design standards a post request will result in creation of a source. Repeated runs is supposed to either create more resources or just throw an errror based on key existence,. Whereas repeated PUT request does not do anything. That is to say PUT
method is idempotent So if we retry a request multiple times, that should be equivalent to a single request invocation.
-
A PUT request will usually have a unique URI pertaining to that resource along with supplied parameters. Ex: PUT /questions/{question-id}
. A POST on the other hand will not have one because the resource is not expected to exist. It is the parameters/post entity that matter more.
Now coming to the streamTarget API, the URI for both PUT and POST is the same. If you look at the example the uri is:
http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testlive/pushpublish/mapentries/ppsource
I believe it is so because the JSON object that is provided as entity facilitates in creating the internal map (like a hashmap or something). The JSON items serve as key-value pairs for he map directly. I believe this type of resource cannot have a separate resource ID associated with it as the entryName
seems to be the main resource. So when you POST the internal properties map is created and when you PUT the map is updated. While i do agree that all properties should not ideally be mandatory and that properties can be selectively updated in a map, i guess that is a design decision taken by wowza developers.
This is my 2 cents on this, unless wowza staff have a different explanation.