company logo

PATCH Query

In order to update data, a PATCH query may be defined, which allows updating specific (defined) values in an instance.

Similar to the PUT query, this is an elementary way for updating instances and usually not able to execute related actions. When, however, a method has been implemented for updating person data, one could also call the implemented method.

Update

Field assignments are similar to PUT query. Only the query type differs:

Class/type

Query/variable

Source

Comment

Person/PATCH

Update

Persons

Person collection

    name

name

Family name for person to be created

    birth

birth_date

Person's birth date

    married

married

Marital status

The PATCH request generated from this mapping looks like:

Test: http://localhost:2000/query/PUT/Person/Create?

      id=P124&&name=Hover&birth="1.1.1999"&married=false

PATCH

user

pwd

/Persons(?id)

{

  name : ?name,

  birth_date : ?birth,

  married : ?married,

  pid : ?id }

Result

In case of success, the request returns an internal code 3 and a message:

{ code=3, message="Instance(s) updated" }