How would this interface look (based on the image)?
Depends on your system, but typically a system that implements the REST API (Web API 2 is one of the frameworks that implements the standard) is supported by these four methods (% , GET
, POST
and PUT
). Here is a list of all methods supported by the HTTP protocol . Most of them are not essential. You implement if you want.
The interface is usually defined by the default route + method. In your example, you know that if you call DELETE
by /orders
, you get the complete list of entities of type GET
of service, and if you pass a serialized object by order
(as a JSON, which is the most common, even an XML), you are inserting a new entity of type PUT
into that service store.
In the case of Web API 2, documentation on the interfaces is automatically generated by the framework . This feature is known as order
.
How would the feature (ID) look like if you want to pass a json object, for example?
It depends on each service. If you implement a service accepting that ApiExplorer
will be defined by a id
request or even PUT
(which is not recommended, but it is possible). Most services define the id of the new record by itself. When this happens, the new record data is returned in the request response header. You can read more about this here ("Creating a Resource" section).