You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- standardise on entityset (vs entity set)
- generalise the "maximise" button reference (as it's changed)
- explain the trailing escaped newline in the code snippet from the hub
- explain the default sticky scroll behaviour in dev space terminals
- draw attention to the $inlinecount option
- A trial account on the SAP Business Technology Platform
16
-
- A subscription to the SAP Business Application Studio, with a basic dev space set up
16
+
- A subscription to the SAP Business Application Studio
17
17
18
18
See [Create a Dev Space for Business Applications](https://developers.sap.com/tutorials/appstudio-devspace-create.html).
19
19
@@ -60,7 +60,7 @@ These notes might help you to better examine and understand the invocation:
60
60
- The `--request GET` option is actually unnecessary as `curl` will use the method appropriate to the rest of the options given; in this case it will automatically use `GET`.
61
61
- The OData system query options have been URL-encoded (this is actually called [Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding)). Specifically, the occurrences of `%24` are just `$` characters, encoded. Knowing this may make reading the URL easier, in that they are the start of normal OData query parameters `$inlinecount=allpages` and `$top=50`.
62
62
- The `DataServiceVersion: 2.0` header is to explicitly signal that the request is for OData V2; this is optional, and arguably unnecessary as the OData API only supports V2 anyway.
63
-
- Perhaps the most interesting header here is the `Accept: application/json`. This forms part of standard HTTP [content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation) and here represents a desire for the resource being requested to be returned in a JSON representation. If the value of this header were to be set to `application/xml` then the entity set resource would be returned in an XML representation, aligned with what OData supports.
63
+
- Perhaps the most interesting header here is the `Accept: application/json`. This forms part of standard HTTP [content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Content_negotiation) and here represents a desire for the resource being requested to be returned in a JSON representation. If the value of this header were to be set to `application/xml` then the entityset resource would be returned in an XML representation, aligned with what OData supports.
64
64
65
65
66
66
### Get ready to run the code snippet
@@ -71,12 +71,14 @@ In the SAP Business Application Studio, create a dev space, giving it a name and
71
71
72
72
> You can choose any kind of dev space, but to emphasize that the command line tools you'll be using are available in all of them, we want you to choose this "Basic" kind.
73
73
74
-
Once the dev space has started up, open up a terminal with the menu path **Terminal -> New Terminal** (the menu is available via the three horizontal bar icon in the top left). Now you have a shell prompt in which to run the code snippet, specifically invoking `curl`. At this point you may wish to maximize the terminal with the up arrow (`^`) button on the right hand side.
74
+
Once the dev space has started up, open up a terminal with the menu path **Terminal -> New Terminal** (the menu is available via the three horizontal bar icon in the top left). Now you have a shell prompt in which to run the code snippet, specifically invoking `curl`. At this point you may wish to maximize the terminal with the appropriate button on the right hand side.
75
75
76
-
Copy the code snippet from the SAP Business Accelerator Hub page and paste it into the terminal. When you run the command, you should see output that looks something like this:
76
+
Copy the code snippet from the SAP Business Accelerator Hub page and paste it into the terminal, making sure to either omit the last escaped newline (the `\` symbol at the end of the last line) or include the whitespace and comment that follows the command, when copying. When you run the command, you should see output that looks something like this:
> Because of the default behavior of dev space terminals in the SAP Business Application Studio, which includes "sticky scroll" being enabled, it looks like a trailing backslash was indeed the last thing pasted in, but that's not the case - the trailing comment was included too.
81
+
80
82
You'll notice that the output is not formatted and is not easy to read. To address this you can use the command line JSON processor [jq](https://jqlang.org/). It's not just a JSON formatter, it's an entire language for handling, processing, generating and modifying JSON data, but here we'll just use its most basic feature, which is the identity function `.`. This just emits what's received, with no transformations. How is that useful? Well, unless you say otherwise (with the `-c` and `-M` options, in case you're curious), `jq` will, by default, pretty-print (and colorize) any JSON it emits.
81
83
82
84
> You can also invoke `jq` just on its own, without specifying the `.` identity filter; in this case, the identity filter will be used as default anyway.
@@ -127,7 +129,9 @@ The output should now appear pretty-printed, something like this (all but one of
127
129
}
128
130
```
129
131
130
-
The formatted output represents the results of a simple call to the Campaign Collection API endpoint - an OData entity set.
132
+
The formatted output represents the results of a simple call to the Campaign Collection API endpoint - an OData entityset.
133
+
134
+
> Depending on the parameter settings in the Try Out facility, you may or may not see the `$inlinecount=allpages` option in use, which causes a top level `__count` property to be included in the resource output. You may wish to experiment with setting a value for `$inlinecount` in the Parameters section.
0 commit comments