Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • To get the service document:

    Code Block
    GET https://localhost:82438280/odata/ODataSampleService/defaultĀ 
    Accept : application/json
  • To get the meta data of the service:

    Code Block
    GET https://localhost:82438280/odata/ODataSampleService/default/$metadata
    Accept : application/xml
  • To read customer details:

    Code Block
    GET https://localhost:82438280/odata/ODataSampleService/default/CUSTOMERS
    Accept : application/json
  • To add accounts details, send the HTTP request as shown below. In this example we will be creating an account ID named "1".

    Code Block
    POST https://localhost:82438280/odata/ODataSampleService/default/ACCOUNTS
    Accept: application/json
    Content-Type: application/json
    Prefer : return=representation
    { "BALANCE" : 12.22 ,"ACCOUNTID" : 1 }
  • To delete account details, send the HTTP request as shown below. In this example, we will be deleting the account ID "1".

    Code Block
    DELETE https://localhost:82438280/odata/ODataSampleService/default/ACCOUNTS(1)
    Accept: application/json
  • To update account details:

    Code Block
    PUT  https://localhost:82438280/odata/ODataSampleService/default/ACCOUNTS(1)
    Accept: application/json
    { "BALANCE" : 12.22 }
  • To invoke a particular query, send the HTTP request as shown below. In this example, we will receive the city and phone numbers of customers.

    Code Block
    GET  https://localhost:82438280/odata/ODataSampleService/default/CUSTOMERS?$select=CITY,PHONE
    Accept: application/json
  • To filter information based on a query, send the HTTP request as shown below. In this example, we will receive the employee details connected to the 'Nantes' city.

    Code Block
    GET https://localhost:82438280/odata/ODataSampleService/default/CUSTOMERS?$filter=CITY eq 'Nantes'
    Accept: application/json