JSON: erinevus redaktsioonide vahel

Allikas: Excellent || Opendoc
Mine navigeerimisribale Mine otsikasti
(Uus lehekülg: 'In versions built after 2021-11-02 b18 Update Note from Erik Elmgren: 1. The API now replies with JSON data if you specify: Accept: application/json in the HTTP headers e....')
 
Resümee puudub
 
1. rida: 1. rida:
In versions built after 2021-11-02 b18  
In versions built after 2021-11-02 b18  


Update Note from Erik Elmgren:
1. The API now replies with JSON data if you specify:  
 
1. The API now replies with JSON data if you specify:


Accept: application/json
Accept: application/json
24. rida: 22. rida:


4. If an incomplete record (only some fields are specified) is sent to the PATCH (update) function the remaining fields are fetched from the current record in the database. The logic is to first read the fields from the main key, then load the existing record, and finally set all the fields sent in the JSON data.
4. If an incomplete record (only some fields are specified) is sent to the PATCH (update) function the remaining fields are fetched from the current record in the database. The logic is to first read the fields from the main key, then load the existing record, and finally set all the fields sent in the JSON data.
5. The new method of POST and PATCH does not accept XML data at this time. It it planned for some time in the future but not a priority to implement.
Sample attached.
_______________________

Viimane redaktsioon: 20. juuli 2023, kell 08:41

In versions built after 2021-11-02 b18

1. The API now replies with JSON data if you specify:

Accept: application/json

in the HTTP headers

e.g.

curl -X GET \

    -H "Accept: application/json" \

   'http://SJ:Sample99@localhost:8033/api/1/ObjVc'

2. The API can now consume JSON data. POST or PATCH data in JSON format with a Content-Type of application/json

The JSON data is the same both when reading and when writing back to the database.

3. If changes to a record is specified in the "old" way with set_field the window actions for the primary DClass is executed plus all the normal record actions when saving a record. If a record is specified in the new way as posted JSON data only the normal record actions are executed, not the window actions.

4. If an incomplete record (only some fields are specified) is sent to the PATCH (update) function the remaining fields are fetched from the current record in the database. The logic is to first read the fields from the main key, then load the existing record, and finally set all the fields sent in the JSON data.