mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-24 03:16:40 +00:00
switch requests examples to version with values
This commit is contained in:
@@ -262,16 +262,16 @@ curl -X POST https://api.netbird.io/api/users/{userId}/tokens \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}'
|
||||
```
|
||||
|
||||
```js
|
||||
const axios = require('axios');
|
||||
let data = JSON.stringify({
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
});
|
||||
let config = {
|
||||
method: 'post',
|
||||
@@ -301,8 +301,8 @@ import json
|
||||
|
||||
url = "https://api.netbird.io/api/users/{userId}/tokens"
|
||||
payload = json.dumps({
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
})
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -331,8 +331,8 @@ func main() {
|
||||
method := "POST"
|
||||
|
||||
payload := strings.NewReader(`{
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}`)
|
||||
client := &http.Client {
|
||||
}
|
||||
@@ -379,8 +379,8 @@ request["Accept"] = "application/json"
|
||||
request["Authorization"] = "Token <TOKEN>"
|
||||
|
||||
request.body = JSON.dump({
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
})
|
||||
response = https.request(request)
|
||||
puts response.read_body
|
||||
@@ -391,8 +391,8 @@ OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
RequestBody body = RequestBody.create(mediaType, '{
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}');
|
||||
Request request = new Request.Builder()
|
||||
.url("https://api.netbird.io/api/users/{userId}/tokens")
|
||||
@@ -420,8 +420,8 @@ curl_setopt_array($curl, array(
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
|
||||
CURLOPT_POSTFIELDS =>'{
|
||||
"name": "string",
|
||||
"expires_in": "integer"
|
||||
"name": "My first token",
|
||||
"expires_in": 30
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
|
||||
Reference in New Issue
Block a user