Protocol
1
2
3
4
5
{
"Name": "RESTable.Admin.Protocol",
"Kind": "EntityResource",
"Methods": ["GET", "REPORT", "HEAD"]
}
The Protocol resource lists all protocol providers that have been added to the current RESTable application, as well as their respective available input and output content types. The RESTable protocol is always enabled, but others can be added by the developer. See this section of the documentation for more information on how to add custom protocol providers.
Format
| Property name | Type | Description |
|---|---|---|
| Name | string |
The name of the protocol |
| Identifier | string |
A unique identifier for the protocol |
| IsDefault | boolean |
Is this the default protocol? |
| ContentTypes | array of ContentTypeInfo |
The content types supported in this protocol |
ContentTypeInfo
ContentTypeInfo objects describe content types that are available for some protocol in a RESTable application.
Format
| Property name | Type | Description |
|---|---|---|
| Name | string |
The name of the content type |
| MimeType | string |
The MIME type string of the content type |
| CanRead | boolean |
Can the given protocol read from requests using this content type? |
| CanWrite | boolean |
Can the given protocol write to responses using this content type? |
| Bindings | array of string |
The available header values that can be used to bind a request to this content type |
Example
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
GET https://myapp.com/api/protocol
Accept: application/json;raw=true
Response body:
[{
"Name": "RESTable",
"Identifier": "restable",
"IsDefault": true,
"ContentTypes": [
{
"Name": "JSON",
"MimeType": "application/json",
"CanRead": true,
"CanWrite": true,
"Bindings": [
"application/json",
"application/restable-json",
"json",
"text/plain"
]
},
{
"Name": "Microsoft Excel",
"MimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"CanRead": true,
"CanWrite": true,
"Bindings": [
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/restable-excel",
"excel"
]
},
{
"Name": "JSON Lines",
"MimeType": "application/jsonlines",
"CanRead": false,
"CanWrite": true,
"Bindings": [
"application/jsonlines",
"application/x-ndjson",
"application/x-jsonlines",
"jl"
]
}
]
}]