0% found this document useful (0 votes)
16 views4 pages

Requesting Data

The document provides guidance on how to request data from OData services using HTTP requests, including fetching entity collections and individual entities. It details the structure of request URLs and response payloads in JSON format for both simple and complex properties. Additionally, it explains how to access raw property values directly from the service.

Uploaded by

asfranco805
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Requesting Data

The document provides guidance on how to request data from OData services using HTTP requests, including fetching entity collections and individual entities. It details the structure of request URLs and response payloads in JSON format for both simple and complex properties. Additionally, it explains how to access raw property values directly from the service.

Uploaded by

asfranco805
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
2126/25, 8:05 AM GGatting data - OData | Microsoft Learn Requesting Data Article + 12/08/2022 OData services support requests for data via HTTP eT requests Requesting Entity Collections The request below returns the the collection of Person People. GET serviceRoot/People Response Payload JSON serviceRoot/$metadatatiPeople", “serviceRoot/People?%24skiptoken=8" ‘@odata. context" ‘@odata.nextLink": “odata.id": “serviceRoot/People( ‘russellwhyte")", “Godata.etay a016948D49A0F21\"", “Godata.editLink": "serviceRoot/People( ‘russellwhyte’)", "UserName": "russellwhyte", “FirstName’ Russell", “LastName” “emails”: [ “Russel l@example. con” “Russell@contoso. com" 1 "AddressInfo": t [ "Address": weity": { “countryRegion": Boise”, "2 "TD" "187 Suffolk Ln.", “United States", 1, Gender": “Male”, 635404796846280400 titpseam microsoft comen-uslodatalconcoptsiget data wa 726725, 8.05 AM Geting data - OData | Meosof Learn “@odata.id": “serviceRoot/People('keithpinckney')", “@odata.etag”: "W/\"@8D16948D49A0F11\"", “@odata.editLink": "serviceRoot/People( ‘keithpinckney’)", "UserName": "keithpinckney", "FirstName": "Keith", “LastName”: "Pinckney", “Emails”: [ "Keith@example. cor Keith@contoso. com 1, “AddressInfo": [], "Gender": "Male", "Concurrency": 635404796846280400 Requesting an Individual Entity by ID The request below returns an individual entity of type Person by the given UserName “russellwhyte" GET serviceRoot/People(''russellwhyte' ) Response Payload JSON “@odata.context": “serviceRoot/$metadataiPeople/Sentity”, @odata.id": “serviceRoot/People( ‘russellwhyte’)", @odata.etag": "W/\"@8D1694BF26028C9\"", @odata.editLink": “serviceRoot/People(‘russellwhyte’)", UserName": "russellwhyte", FirstName": "Russell", LastName": “whyte", Emails" [email protected]" "Russel [email protected]" titpseam microsoft comen-uslodatalconcoptsiget data 218 3126/25, 8:05 AM GGatting data - OData | Microsoft Learn ender": "Male", concurrency": 63540479734665520@ Requesting an Individual Property To address an entity property clients append a path segment containing property name to the URL of the entity. If the property has a complex type, properties of that value can be addressed by further property name composition. First let's take a look at how to get a simple property. The request below returns the Name property of an Airport. GET serviceRoot/Airports('KSFO')/Name Response Payload JSON 1 "serviceRoot/$metadata#Ainports('KSFO")/Name" , San Francisco International Airport” Then let's see how to get a property value of a complex type. The request below returns the Address of the complex type Location in an Airport. cet serviceRoot /Airports('KSFO" )/Location/Address Response Payload JSON { ‘@odata.. context’ ‘value’ serviceRoot /$metadata#Airports('KSFO')/Location/Addres: South McDonnell Road, San Francisco, CA 94128" } Requesting an Individual Property Raw Value To address the raw value of a primitive property, clients append a path segment containing the string $value to the property URL. The request below returns the raw value of property titpseam microsoft comen-uslodatalconcoptsiget-data aia 2126/25, 8:05 AM GGatting data - OData | Microsoft Learn ‘Name of an Airport. GET serviceRoot/Airports( 'KSFO" )/Nane/$value Response Payload JSON San Francisco International Airport Feedback Was this page helpful? titpseam microsoft comen-uslodatalconcoptsiget-data 48

You might also like