mirror of
https://github.com/netbirdio/docs.git
synced 2026-05-02 07:16:37 +00:00
switch requests examples to version with values
This commit is contained in:
@@ -248,16 +248,16 @@ curl -X PUT https://api.netbird.io/api/accounts/{accountId} \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
});
|
||||
let config = {
|
||||
method: 'put',
|
||||
@@ -287,8 +287,8 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/accounts/{accountId}"
|
||||
payload = json.dumps({
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
})
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -317,8 +317,8 @@ func main() {
|
||||
method := "PUT"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -365,8 +365,8 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -377,8 +377,8 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/accounts/{accountId}")
|
||||
@@ -406,8 +406,8 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_CUSTOMREQUEST => 'PUT',
|
||||
|
||||
CURLOPT_POSTFIELDS =>'{
|
||||
"peer_login_expiration_enabled": "boolean",
|
||||
"peer_login_expiration": "integer"
|
||||
"peer_login_expiration_enabled": true,
|
||||
"peer_login_expiration": 43200
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
|
||||
Reference in New Issue
Block a user