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

@@ -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',