switch requests examples to version with values

This commit is contained in:
Pascal Fischer
2023-05-05 18:04:17 +02:00
parent adf57d5294
commit 05cbda8cd8
11 changed files with 756 additions and 756 deletions

View File

@@ -528,18 +528,18 @@ curl -X PUT https://api.netbird.io/api/peers/{peerId} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
}'
```
```js
const axios = require('axios');
let data = JSON.stringify({
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
});
let config = {
method: 'put',
@@ -569,9 +569,9 @@ import json
url = "https://api.netbird.io/api/peers/{peerId}"
payload = json.dumps({
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
})
headers = {
'Content-Type': 'application/json',
@@ -600,9 +600,9 @@ func main() {
method := "PUT"
payload := strings.NewReader(`{
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
}`)
client := &http.Client {
}
@@ -649,9 +649,9 @@ request["Accept"] = "application/json"
request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
})
response = https.request(request)
puts response.read_body
@@ -662,9 +662,9 @@ OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
}');
Request request = new Request.Builder()
.url("https://api.netbird.io/api/peers/{peerId}")
@@ -692,9 +692,9 @@ curl_setopt_array($curl, array(
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "string",
"ssh_enabled": "boolean",
"login_expiration_enabled": "boolean"
"name": "stage-host-1",
"ssh_enabled": true,
"login_expiration_enabled": false
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',