Skip to content

Commit

Permalink
Add highlighting style to codeblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
aitormurgu committed Mar 11, 2024
1 parent 01aa14d commit a6af533
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions docs/How-to guides/How to update device firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ The reason why the firmware update message is sent with the MQTT Retained flag s

The payload of the MQTT message is a UTF-8 encoded string, that holds a JSON object with the following content:

```
```json
{
"firmware-name": "firmware name",
"download-url": "https://firmware-download-url"
"name": "firmware name",
"download-url": "https://firmware-download-url",
"size": 0,
"md5": "hash",
"sha1": "hash",
"sha256": "hash"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ However in order to call the **http-forwarder** service you have to identify you
With that information you can craft an HTTP request for this simulation to get the token. In this tutorial, it is assumed you have some experience working the terminal. As said at the beginning of this tutorial, **HTTPie** and **cURL** tools will be used to provide examples for HTTP requests. Here is the request to retrieve the token using both tools (please make sure to adjust the request with your own credentials):


```jsx title="HTTPie"
```bash title="HTTPie"
http --form POST \
https://auth.biotz.io/realms/biotz-platform/protocol/openid-connect/token \
username=~HTTP USER FROM CSV~ \
Expand All @@ -31,7 +31,7 @@ scope=openid
```
<br></br>

```jsx title="cURL"
```bash title="cURL"
curl --request POST \
--url https://auth.biotz.io/realms/biotz-platform/protocol/openid-connect/token \
--data-urlencode username=~HTTP USERNAME FROM CSV~ \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ In this case the **Object** is an JSON object since the **mytestmessag** definit
<br></br>
Now, the request is very simple, you will send just a single sample of data (a single request in this case) to the platform. Here is an example using both HTTPie and cURL.

```jsx title="HTTPie"
```bash title="HTTPie"
http --auth-type bearer \
--auth ~YOUR ID_TOKEN~ \
POST https://ingestion-http.biotz.io/api/device/publish/data/mytestmessag \
hum=20.5 temp=25.6
```
<br></br>

```jsx title="cURL"
```bash title="cURL"
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer ~YOUR ID_TOKEN~" \
--request POST \
Expand All @@ -35,7 +35,7 @@ https://ingestion-http.biotz.io/api/device/publish/data/~INTERNAL NAME OF MESSAG
<br></br>

The response should look like this:
```
```json
{
"success?": true,
"details": {}
Expand Down
1 change: 1 addition & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const config: Config = {
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['clojure','json','bash'],
},
} satisfies Preset.ThemeConfig,
};
Expand Down

0 comments on commit a6af533

Please sign in to comment.