-
Notifications
You must be signed in to change notification settings - Fork 716
Expand file tree
/
Copy pathAdvancedODataWebApiExample.http
More file actions
78 lines (59 loc) · 2.41 KB
/
AdvancedODataWebApiExample.http
File metadata and controls
78 lines (59 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
###
# AdvancedODataWebApiExample - ASP.NET OData Web API Advanced Versioning
# This example demonstrates advanced OData scenarios with multiple versioning strategies for legacy ASP.NET Web API
###
@baseUrl = http://localhost:52667
### People - Get All (Default Version)
# Get all people (defaults to latest version when AssumeDefaultVersionWhenUnspecified is enabled)
GET {{baseUrl}}/api/people
### People - Get All - Version 1.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=1.0
### People - Get All with $select - Version 1.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=1.0&$select=FirstName,LastName
### People - Get All with $filter - Version 1.0
# Get filtered people
GET {{baseUrl}}/api/people?api-version=1.0&$filter=Id eq 1
### People - Get by Key - Version 1.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=1.0
### People - Get All - Version 2.0
# Get all people using OData query
GET {{baseUrl}}/api/people?api-version=2.0
### People - Get All with $select - Version 2.0
# Get all people with specific fields
GET {{baseUrl}}/api/people?api-version=2.0&$select=FirstName,LastName,Email
### People - Get by Key - Version 2.0
# Get a specific person by ID
GET {{baseUrl}}/api/people/1?api-version=2.0
### People (V2) - Get All - Version 2.0
# Get all people from version 2 specific controller
GET {{baseUrl}}/api/people2?api-version=2.0
### People (V2) - Get by Key - Version 2.0
# Get a specific person by ID from version 2 controller
GET {{baseUrl}}/api/people2/1?api-version=2.0
### Orders - Get All - Version 1.0
# Get all orders
GET {{baseUrl}}/api/v1/orders
### Orders - Get All with $select - Version 1.0
# Get orders with specific fields
GET {{baseUrl}}/api/v1/orders?$select=Id,Customer
### Orders - Get by Key - Version 1.0
# Get a specific order by ID
GET {{baseUrl}}/api/v1/orders/1
### Orders - Get All - Version 2.0
# Get all orders for version 2.0
GET {{baseUrl}}/api/v2/orders
### Orders - Get by Key - Version 2.0
# Get a specific order by ID for version 2.0
GET {{baseUrl}}/api/v2/orders/1
### Orders - Get All - Version 3.0
# Get all orders for version 3.0
GET {{baseUrl}}/api/v3/orders
### Orders - Get by Key - Version 3.0
# Get a specific order by ID for version 3.0
GET {{baseUrl}}/api/v3/orders/1
### Orders - Get All with $expand - Version 3.0
# Get orders with expanded customer details
GET {{baseUrl}}/api/v3/orders?$expand=customer