Drill4J API
PATCH
Block user
{{baseUrl}}/api/users/:userId/block
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users/:userId/block");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/api/users/:userId/block" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/users/:userId/block"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.patch url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/api/users/:userId/block"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users/:userId/block");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users/:userId/block"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/api/users/:userId/block HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/api/users/:userId/block")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users/:userId/block"))
.header("x-api-key", "{{apiKey}}")
.method("PATCH", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users/:userId/block")
.patch(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/api/users/:userId/block")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/api/users/:userId/block');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/block',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users/:userId/block';
const options = {method: 'PATCH', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users/:userId/block',
method: 'PATCH',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/users/:userId/block")
.patch(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users/:userId/block',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/block',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/api/users/:userId/block');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/block',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users/:userId/block';
const options = {method: 'PATCH', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users/:userId/block"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users/:userId/block" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users/:userId/block",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/api/users/:userId/block', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users/:userId/block');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/users/:userId/block');
$request->setRequestMethod('PATCH');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users/:userId/block' -Method PATCH -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users/:userId/block' -Method PATCH -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PATCH", "/baseUrl/api/users/:userId/block", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users/:userId/block"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.patch(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users/:userId/block"
response <- VERB("PATCH", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users/:userId/block")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/api/users/:userId/block') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users/:userId/block";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/api/users/:userId/block \
--header 'x-api-key: {{apiKey}}'
http PATCH {{baseUrl}}/api/users/:userId/block \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/users/:userId/block
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users/:userId/block")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete API key
{{baseUrl}}/api/api-keys/:id
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/api-keys/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/api-keys/:id" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/api-keys/:id"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/api/api-keys/:id"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/api-keys/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/api-keys/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/api/api-keys/:id HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/api-keys/:id")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/api-keys/:id"))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/api-keys/:id")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/api-keys/:id")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/api/api-keys/:id');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/api-keys/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/api-keys/:id';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/api-keys/:id',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/api-keys/:id")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/api-keys/:id',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/api-keys/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/api-keys/:id');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/api-keys/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/api-keys/:id';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/api-keys/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/api-keys/:id" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/api-keys/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/api/api-keys/:id', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/api-keys/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/api-keys/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/api-keys/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/api-keys/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/api/api-keys/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/api-keys/:id"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/api-keys/:id"
response <- VERB("DELETE", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/api-keys/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/api/api-keys/:id') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/api-keys/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/api/api-keys/:id \
--header 'x-api-key: {{apiKey}}'
http DELETE {{baseUrl}}/api/api-keys/:id \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/api-keys/:id
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/api-keys/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete user API key
{{baseUrl}}/api/user-keys/:id
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/user-keys/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/user-keys/:id" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/user-keys/:id"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/api/user-keys/:id"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/user-keys/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/user-keys/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/api/user-keys/:id HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/user-keys/:id")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/user-keys/:id"))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/user-keys/:id")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/user-keys/:id")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/api/user-keys/:id');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/user-keys/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/user-keys/:id';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/user-keys/:id',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/user-keys/:id")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/user-keys/:id',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/user-keys/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/user-keys/:id');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/user-keys/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/user-keys/:id';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/user-keys/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/user-keys/:id" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/user-keys/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/api/user-keys/:id', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/user-keys/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/user-keys/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/user-keys/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/user-keys/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/api/user-keys/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/user-keys/:id"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/user-keys/:id"
response <- VERB("DELETE", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/user-keys/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/api/user-keys/:id') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/user-keys/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/api/user-keys/:id \
--header 'x-api-key: {{apiKey}}'
http DELETE {{baseUrl}}/api/user-keys/:id \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/user-keys/:id
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/user-keys/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete user
{{baseUrl}}/api/users/:userId
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users/:userId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/users/:userId" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/users/:userId"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/api/users/:userId"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users/:userId");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users/:userId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/api/users/:userId HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/users/:userId")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users/:userId"))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users/:userId")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/users/:userId")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/api/users/:userId');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users/:userId';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users/:userId',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/users/:userId")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users/:userId',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/users/:userId');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users/:userId';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users/:userId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users/:userId" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/api/users/:userId', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users/:userId');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/users/:userId');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users/:userId' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users/:userId' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/api/users/:userId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users/:userId"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users/:userId"
response <- VERB("DELETE", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/api/users/:userId') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users/:userId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/api/users/:userId \
--header 'x-api-key: {{apiKey}}'
http DELETE {{baseUrl}}/api/users/:userId \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/users/:userId
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users/:userId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Edit user
{{baseUrl}}/api/users/:userId
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
userId
BODY json
{
"username": "",
"email": "",
"role": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users/:userId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/users/:userId" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:username ""
:email ""
:role ""}})
require "http/client"
url = "{{baseUrl}}/api/users/:userId"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/users/:userId"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users/:userId");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users/:userId"
payload := strings.NewReader("{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/users/:userId HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"username": "",
"email": "",
"role": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/users/:userId")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users/:userId"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users/:userId")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/users/:userId")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}")
.asString();
const data = JSON.stringify({
username: '',
email: '',
role: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/users/:userId');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {username: '', email: '', role: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users/:userId';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"username":"","email":"","role":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users/:userId',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "username": "",\n "email": "",\n "role": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/users/:userId")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users/:userId',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({username: '', email: '', role: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {username: '', email: '', role: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/users/:userId');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
username: '',
email: '',
role: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {username: '', email: '', role: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users/:userId';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"username":"","email":"","role":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"username": @"",
@"email": @"",
@"role": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users/:userId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users/:userId" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'username' => '',
'email' => '',
'role' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/users/:userId', [
'body' => '{
"username": "",
"email": "",
"role": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users/:userId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'username' => '',
'email' => '',
'role' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'username' => '',
'email' => '',
'role' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/users/:userId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users/:userId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"username": "",
"email": "",
"role": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users/:userId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"username": "",
"email": "",
"role": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/api/users/:userId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users/:userId"
payload = {
"username": "",
"email": "",
"role": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users/:userId"
payload <- "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/users/:userId') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"username\": \"\",\n \"email\": \"\",\n \"role\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users/:userId";
let payload = json!({
"username": "",
"email": "",
"role": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/users/:userId \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"username": "",
"email": "",
"role": ""
}'
echo '{
"username": "",
"email": "",
"role": ""
}' | \
http PUT {{baseUrl}}/api/users/:userId \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "username": "",\n "email": "",\n "role": ""\n}' \
--output-document \
- {{baseUrl}}/api/users/:userId
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"username": "",
"email": "",
"role": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users/:userId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Generate API key
{{baseUrl}}/api/api-keys
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/api-keys");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/api-keys" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/api/api-keys"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/api-keys"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/api-keys");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/api-keys"
payload := strings.NewReader("{\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/api-keys HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/api-keys")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/api-keys"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/api-keys")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/api-keys")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/api-keys');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/api-keys',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/api-keys';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/api-keys',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/api-keys")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/api-keys',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/api-keys',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/api-keys');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/api-keys',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/api-keys';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/api-keys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/api-keys" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/api-keys', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/api-keys');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/api-keys');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/api-keys' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/api-keys' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/api/api-keys", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/api-keys"
payload = { "name": "" }
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/api-keys"
payload <- "{\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/api-keys') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/api-keys";
let payload = json!({"name": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/api-keys \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http POST {{baseUrl}}/api/api-keys \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/api/api-keys
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/api-keys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Generate user API key
{{baseUrl}}/api/user-keys
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/user-keys");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/user-keys" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/api/user-keys"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/user-keys"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/user-keys");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/user-keys"
payload := strings.NewReader("{\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/user-keys HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/user-keys")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/user-keys"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/user-keys")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/user-keys")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/user-keys');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/user-keys',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/user-keys';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/user-keys',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/user-keys")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/user-keys',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/user-keys',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/user-keys');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/user-keys',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/user-keys';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/user-keys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/user-keys" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/user-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/user-keys', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/user-keys');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/user-keys');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/user-keys' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/user-keys' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/api/user-keys", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/user-keys"
payload = { "name": "" }
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/user-keys"
payload <- "{\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/user-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/user-keys') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/user-keys";
let payload = json!({"name": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/user-keys \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http POST {{baseUrl}}/api/user-keys \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/api/user-keys
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/user-keys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get API keys
{{baseUrl}}/api/api-keys
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/api-keys");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/api-keys" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/api-keys"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/api-keys"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/api-keys");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/api-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/api-keys HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/api-keys")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/api-keys"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/api-keys")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/api-keys")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/api-keys');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/api-keys',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/api-keys';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/api-keys',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/api-keys")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/api-keys',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/api-keys',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/api-keys');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/api-keys',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/api-keys';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/api-keys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/api-keys" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/api-keys', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/api-keys');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/api-keys');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/api-keys' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/api-keys' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/api-keys", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/api-keys"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/api-keys"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/api-keys') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/api-keys";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/api-keys \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/api-keys \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/api-keys
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/api-keys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get user API keys
{{baseUrl}}/api/user-keys
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/user-keys");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/user-keys" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/user-keys"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/user-keys"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/user-keys");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/user-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/user-keys HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/user-keys")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/user-keys"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/user-keys")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/user-keys")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/user-keys');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/user-keys',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/user-keys';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/user-keys',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/user-keys")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/user-keys',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/user-keys',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/user-keys');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/user-keys',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/user-keys';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/user-keys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/user-keys" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/user-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/user-keys', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/user-keys');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/user-keys');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/user-keys' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/user-keys' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/user-keys", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/user-keys"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/user-keys"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/user-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/user-keys') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/user-keys";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/user-keys \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/user-keys \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/user-keys
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/user-keys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get user by ID
{{baseUrl}}/api/users/:userId
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users/:userId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/users/:userId" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/users/:userId"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/users/:userId"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users/:userId");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users/:userId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/users/:userId HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/users/:userId")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users/:userId"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users/:userId")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/users/:userId")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/users/:userId');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users/:userId';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users/:userId',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/users/:userId")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users/:userId',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/users/:userId');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/users/:userId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users/:userId';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users/:userId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users/:userId" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/users/:userId', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users/:userId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/users/:userId');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users/:userId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users/:userId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/users/:userId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users/:userId"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users/:userId"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/users/:userId') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users/:userId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/users/:userId \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/users/:userId \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/users/:userId
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users/:userId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get user info
{{baseUrl}}/api/user-info
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/user-info");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/user-info" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/user-info"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/user-info"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/user-info");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/user-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/user-info HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/user-info")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/user-info"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/user-info")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/user-info")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/user-info');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/user-info',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/user-info';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/user-info',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/user-info")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/user-info',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/user-info',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/user-info');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/user-info',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/user-info';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/user-info"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/user-info" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/user-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/user-info', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/user-info');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/user-info');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/user-info' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/user-info' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/user-info", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/user-info"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/user-info"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/user-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/user-info') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/user-info";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/user-info \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/user-info \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/user-info
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/user-info")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get users
{{baseUrl}}/api/users
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/users" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/users"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/users"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/users HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/users")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/users")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/users');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/users',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/users")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/users',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/users');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/users',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/users', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/users');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/users", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/users') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/users \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/users \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/users
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
Reset user password
{{baseUrl}}/api/users/:userId/reset-password
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users/:userId/reset-password");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/api/users/:userId/reset-password" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/users/:userId/reset-password"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.patch url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/api/users/:userId/reset-password"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users/:userId/reset-password");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users/:userId/reset-password"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/api/users/:userId/reset-password HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/api/users/:userId/reset-password")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users/:userId/reset-password"))
.header("x-api-key", "{{apiKey}}")
.method("PATCH", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users/:userId/reset-password")
.patch(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/api/users/:userId/reset-password")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/api/users/:userId/reset-password');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/reset-password',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users/:userId/reset-password';
const options = {method: 'PATCH', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users/:userId/reset-password',
method: 'PATCH',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/users/:userId/reset-password")
.patch(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users/:userId/reset-password',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/reset-password',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/api/users/:userId/reset-password');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/reset-password',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users/:userId/reset-password';
const options = {method: 'PATCH', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users/:userId/reset-password"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users/:userId/reset-password" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users/:userId/reset-password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/api/users/:userId/reset-password', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users/:userId/reset-password');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/users/:userId/reset-password');
$request->setRequestMethod('PATCH');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users/:userId/reset-password' -Method PATCH -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users/:userId/reset-password' -Method PATCH -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PATCH", "/baseUrl/api/users/:userId/reset-password", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users/:userId/reset-password"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.patch(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users/:userId/reset-password"
response <- VERB("PATCH", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users/:userId/reset-password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/api/users/:userId/reset-password') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users/:userId/reset-password";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/api/users/:userId/reset-password \
--header 'x-api-key: {{apiKey}}'
http PATCH {{baseUrl}}/api/users/:userId/reset-password \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/users/:userId/reset-password
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users/:userId/reset-password")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Sign in
{{baseUrl}}/api/sign-in
BODY json
{
"username": "",
"password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/sign-in");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"username\": \"\",\n \"password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/sign-in" {:content-type :json
:form-params {:username ""
:password ""}})
require "http/client"
url = "{{baseUrl}}/api/sign-in"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"username\": \"\",\n \"password\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/sign-in"),
Content = new StringContent("{\n \"username\": \"\",\n \"password\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/sign-in");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"username\": \"\",\n \"password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/sign-in"
payload := strings.NewReader("{\n \"username\": \"\",\n \"password\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/sign-in HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"username": "",
"password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/sign-in")
.setHeader("content-type", "application/json")
.setBody("{\n \"username\": \"\",\n \"password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/sign-in"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"username\": \"\",\n \"password\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"username\": \"\",\n \"password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/sign-in")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/sign-in")
.header("content-type", "application/json")
.body("{\n \"username\": \"\",\n \"password\": \"\"\n}")
.asString();
const data = JSON.stringify({
username: '',
password: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/sign-in');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/sign-in',
headers: {'content-type': 'application/json'},
data: {username: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/sign-in';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"username":"","password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/sign-in',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "username": "",\n "password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"username\": \"\",\n \"password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/sign-in")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/sign-in',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({username: '', password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/sign-in',
headers: {'content-type': 'application/json'},
body: {username: '', password: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/sign-in');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
username: '',
password: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/sign-in',
headers: {'content-type': 'application/json'},
data: {username: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/sign-in';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"username":"","password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"username": @"",
@"password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/sign-in"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/sign-in" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"username\": \"\",\n \"password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/sign-in",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'username' => '',
'password' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/sign-in', [
'body' => '{
"username": "",
"password": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/sign-in');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'username' => '',
'password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'username' => '',
'password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/sign-in');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/sign-in' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"username": "",
"password": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/sign-in' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"username": "",
"password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"username\": \"\",\n \"password\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/sign-in", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/sign-in"
payload = {
"username": "",
"password": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/sign-in"
payload <- "{\n \"username\": \"\",\n \"password\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/sign-in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"username\": \"\",\n \"password\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/sign-in') do |req|
req.body = "{\n \"username\": \"\",\n \"password\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/sign-in";
let payload = json!({
"username": "",
"password": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/sign-in \
--header 'content-type: application/json' \
--data '{
"username": "",
"password": ""
}'
echo '{
"username": "",
"password": ""
}' | \
http POST {{baseUrl}}/api/sign-in \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "username": "",\n "password": ""\n}' \
--output-document \
- {{baseUrl}}/api/sign-in
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"username": "",
"password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/sign-in")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Sign out
{{baseUrl}}/api/sign-out
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/sign-out");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/sign-out")
require "http/client"
url = "{{baseUrl}}/api/sign-out"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/sign-out"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/sign-out");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/sign-out"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/sign-out HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/sign-out")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/sign-out"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/sign-out")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/sign-out")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/sign-out');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/api/sign-out'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/sign-out';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/sign-out',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/sign-out")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/sign-out',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/api/sign-out'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/sign-out');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/api/sign-out'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/sign-out';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/sign-out"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/sign-out" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/sign-out",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/sign-out');
echo $response->getBody();
setUrl('{{baseUrl}}/api/sign-out');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/sign-out');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/sign-out' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/sign-out' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/api/sign-out")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/sign-out"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/sign-out"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/sign-out")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/api/sign-out') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/sign-out";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/sign-out
http POST {{baseUrl}}/api/sign-out
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/api/sign-out
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/sign-out")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Sign up
{{baseUrl}}/api/sign-up
BODY json
{
"username": "",
"password": "",
"email": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/sign-up");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/sign-up" {:content-type :json
:form-params {:username ""
:password ""
:email ""}})
require "http/client"
url = "{{baseUrl}}/api/sign-up"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/sign-up"),
Content = new StringContent("{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/sign-up");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/sign-up"
payload := strings.NewReader("{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/sign-up HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 53
{
"username": "",
"password": "",
"email": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/sign-up")
.setHeader("content-type", "application/json")
.setBody("{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/sign-up"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/sign-up")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/sign-up")
.header("content-type", "application/json")
.body("{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}")
.asString();
const data = JSON.stringify({
username: '',
password: '',
email: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/sign-up');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/sign-up',
headers: {'content-type': 'application/json'},
data: {username: '', password: '', email: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/sign-up';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"username":"","password":"","email":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/sign-up',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "username": "",\n "password": "",\n "email": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/sign-up")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/sign-up',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({username: '', password: '', email: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/sign-up',
headers: {'content-type': 'application/json'},
body: {username: '', password: '', email: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/sign-up');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
username: '',
password: '',
email: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/sign-up',
headers: {'content-type': 'application/json'},
data: {username: '', password: '', email: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/sign-up';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"username":"","password":"","email":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"username": @"",
@"password": @"",
@"email": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/sign-up"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/sign-up" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/sign-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'username' => '',
'password' => '',
'email' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/sign-up', [
'body' => '{
"username": "",
"password": "",
"email": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/sign-up');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'username' => '',
'password' => '',
'email' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'username' => '',
'password' => '',
'email' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/sign-up');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/sign-up' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"username": "",
"password": "",
"email": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/sign-up' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"username": "",
"password": "",
"email": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/api/sign-up", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/sign-up"
payload = {
"username": "",
"password": "",
"email": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/sign-up"
payload <- "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/sign-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/sign-up') do |req|
req.body = "{\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/sign-up";
let payload = json!({
"username": "",
"password": "",
"email": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/sign-up \
--header 'content-type: application/json' \
--data '{
"username": "",
"password": "",
"email": ""
}'
echo '{
"username": "",
"password": "",
"email": ""
}' | \
http POST {{baseUrl}}/api/sign-up \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "username": "",\n "password": "",\n "email": ""\n}' \
--output-document \
- {{baseUrl}}/api/sign-up
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"username": "",
"password": "",
"email": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/sign-up")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
Unblock user
{{baseUrl}}/api/users/:userId/unblock
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
userId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/users/:userId/unblock");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/api/users/:userId/unblock" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/users/:userId/unblock"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.patch url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/api/users/:userId/unblock"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/users/:userId/unblock");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/users/:userId/unblock"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/api/users/:userId/unblock HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/api/users/:userId/unblock")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/users/:userId/unblock"))
.header("x-api-key", "{{apiKey}}")
.method("PATCH", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/users/:userId/unblock")
.patch(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/api/users/:userId/unblock")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/api/users/:userId/unblock');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/unblock',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/users/:userId/unblock';
const options = {method: 'PATCH', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/users/:userId/unblock',
method: 'PATCH',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/users/:userId/unblock")
.patch(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/users/:userId/unblock',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/unblock',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/api/users/:userId/unblock');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/api/users/:userId/unblock',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/users/:userId/unblock';
const options = {method: 'PATCH', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/users/:userId/unblock"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/users/:userId/unblock" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/users/:userId/unblock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/api/users/:userId/unblock', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/users/:userId/unblock');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/users/:userId/unblock');
$request->setRequestMethod('PATCH');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/users/:userId/unblock' -Method PATCH -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/users/:userId/unblock' -Method PATCH -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PATCH", "/baseUrl/api/users/:userId/unblock", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/users/:userId/unblock"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.patch(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/users/:userId/unblock"
response <- VERB("PATCH", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/users/:userId/unblock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/api/users/:userId/unblock') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/users/:userId/unblock";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/api/users/:userId/unblock \
--header 'x-api-key: {{apiKey}}'
http PATCH {{baseUrl}}/api/users/:userId/unblock \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PATCH \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/users/:userId/unblock
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/users/:userId/unblock")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Update password
{{baseUrl}}/api/update-password
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"oldPassword": "",
"newPassword": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/update-password");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/update-password" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:oldPassword ""
:newPassword ""}})
require "http/client"
url = "{{baseUrl}}/api/update-password"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/update-password"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/update-password");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/update-password"
payload := strings.NewReader("{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/update-password HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 44
{
"oldPassword": "",
"newPassword": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/update-password")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/update-password"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/update-password")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/update-password")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}")
.asString();
const data = JSON.stringify({
oldPassword: '',
newPassword: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/update-password');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/update-password',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {oldPassword: '', newPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/update-password';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"oldPassword":"","newPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/update-password',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "oldPassword": "",\n "newPassword": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/update-password")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/update-password',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({oldPassword: '', newPassword: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/update-password',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {oldPassword: '', newPassword: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/update-password');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
oldPassword: '',
newPassword: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/update-password',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {oldPassword: '', newPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/update-password';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"oldPassword":"","newPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"oldPassword": @"",
@"newPassword": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/update-password"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/update-password" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/update-password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oldPassword' => '',
'newPassword' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/update-password', [
'body' => '{
"oldPassword": "",
"newPassword": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/update-password');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'oldPassword' => '',
'newPassword' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'oldPassword' => '',
'newPassword' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/update-password');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/update-password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"oldPassword": "",
"newPassword": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/update-password' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"oldPassword": "",
"newPassword": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/api/update-password", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/update-password"
payload = {
"oldPassword": "",
"newPassword": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/update-password"
payload <- "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/update-password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/update-password') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"oldPassword\": \"\",\n \"newPassword\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/update-password";
let payload = json!({
"oldPassword": "",
"newPassword": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/update-password \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"oldPassword": "",
"newPassword": ""
}'
echo '{
"oldPassword": "",
"newPassword": ""
}' | \
http POST {{baseUrl}}/api/update-password \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "oldPassword": "",\n "newPassword": ""\n}' \
--output-document \
- {{baseUrl}}/api/update-password
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"oldPassword": "",
"newPassword": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/update-password")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete method ignore rule by ID
{{baseUrl}}/api/data-ingest/method-ignore-rules/:id
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/api/data-ingest/method-ignore-rules/:id HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/method-ignore-rules/:id',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/method-ignore-rules/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/method-ignore-rules/:id');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/data-ingest/method-ignore-rules/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/method-ignore-rules/:id' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/api/data-ingest/method-ignore-rules/:id", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id"
response <- VERB("DELETE", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/method-ignore-rules/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/api/data-ingest/method-ignore-rules/:id') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/api/data-ingest/method-ignore-rules/:id \
--header 'x-api-key: {{apiKey}}'
http DELETE {{baseUrl}}/api/data-ingest/method-ignore-rules/:id \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/data-ingest/method-ignore-rules/:id
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/method-ignore-rules/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get all method ignore rules
{{baseUrl}}/api/data-ingest/method-ignore-rules
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/method-ignore-rules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/data-ingest/method-ignore-rules" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/method-ignore-rules"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/method-ignore-rules"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/method-ignore-rules");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/method-ignore-rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/data-ingest/method-ignore-rules HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/data-ingest/method-ignore-rules")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/method-ignore-rules"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/method-ignore-rules")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/data-ingest/method-ignore-rules")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/data-ingest/method-ignore-rules');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/method-ignore-rules';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/method-ignore-rules")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/method-ignore-rules',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/data-ingest/method-ignore-rules');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/method-ignore-rules';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/method-ignore-rules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/method-ignore-rules" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/method-ignore-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/data-ingest/method-ignore-rules', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/method-ignore-rules');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/data-ingest/method-ignore-rules');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/method-ignore-rules' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/method-ignore-rules' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/data-ingest/method-ignore-rules", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/method-ignore-rules"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/method-ignore-rules"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/method-ignore-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/data-ingest/method-ignore-rules') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/method-ignore-rules";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/data-ingest/method-ignore-rules \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/data-ingest/method-ignore-rules \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/data-ingest/method-ignore-rules
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/method-ignore-rules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Save build data
{{baseUrl}}/api/data-ingest/builds
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/builds");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/data-ingest/builds" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:groupId ""
:appId ""
:commitSha ""
:buildVersion ""
:branch ""
:commitDate ""
:commitMessage ""
:commitAuthor ""}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/builds"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/builds"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/builds");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/builds"
payload := strings.NewReader("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/data-ingest/builds HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 156
{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/data-ingest/builds")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/builds"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/builds")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/data-ingest/builds")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}")
.asString();
const data = JSON.stringify({
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
branch: '',
commitDate: '',
commitMessage: '',
commitAuthor: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/data-ingest/builds');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/builds',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
branch: '',
commitDate: '',
commitMessage: '',
commitAuthor: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/builds';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","commitSha":"","buildVersion":"","branch":"","commitDate":"","commitMessage":"","commitAuthor":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/builds',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "groupId": "",\n "appId": "",\n "commitSha": "",\n "buildVersion": "",\n "branch": "",\n "commitDate": "",\n "commitMessage": "",\n "commitAuthor": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/builds")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/builds',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
branch: '',
commitDate: '',
commitMessage: '',
commitAuthor: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/builds',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
branch: '',
commitDate: '',
commitMessage: '',
commitAuthor: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/data-ingest/builds');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
branch: '',
commitDate: '',
commitMessage: '',
commitAuthor: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/builds',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
branch: '',
commitDate: '',
commitMessage: '',
commitAuthor: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/builds';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","commitSha":"","buildVersion":"","branch":"","commitDate":"","commitMessage":"","commitAuthor":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"groupId": @"",
@"appId": @"",
@"commitSha": @"",
@"buildVersion": @"",
@"branch": @"",
@"commitDate": @"",
@"commitMessage": @"",
@"commitAuthor": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/builds"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/builds" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/builds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'groupId' => '',
'appId' => '',
'commitSha' => '',
'buildVersion' => '',
'branch' => '',
'commitDate' => '',
'commitMessage' => '',
'commitAuthor' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/data-ingest/builds', [
'body' => '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/builds');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'groupId' => '',
'appId' => '',
'commitSha' => '',
'buildVersion' => '',
'branch' => '',
'commitDate' => '',
'commitMessage' => '',
'commitAuthor' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'groupId' => '',
'appId' => '',
'commitSha' => '',
'buildVersion' => '',
'branch' => '',
'commitDate' => '',
'commitMessage' => '',
'commitAuthor' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/builds');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/builds' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/builds' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/api/data-ingest/builds", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/builds"
payload = {
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/builds"
payload <- "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/builds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/data-ingest/builds') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"branch\": \"\",\n \"commitDate\": \"\",\n \"commitMessage\": \"\",\n \"commitAuthor\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/builds";
let payload = json!({
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/data-ingest/builds \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}'
echo '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
}' | \
http PUT {{baseUrl}}/api/data-ingest/builds \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "groupId": "",\n "appId": "",\n "commitSha": "",\n "buildVersion": "",\n "branch": "",\n "commitDate": "",\n "commitMessage": "",\n "commitAuthor": ""\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/builds
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"branch": "",
"commitDate": "",
"commitMessage": "",
"commitAuthor": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/builds")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Save coverage data
{{baseUrl}}/api/data-ingest/coverage
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/coverage");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/data-ingest/coverage" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:groupId ""
:appId ""
:instanceId ""
:coverage [{:classname ""
:testId ""
:testSessionId ""
:probes []}]}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/coverage"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/coverage"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/coverage");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/coverage"
payload := strings.NewReader("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/data-ingest/coverage HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 176
{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/data-ingest/coverage")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/coverage"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/coverage")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/data-ingest/coverage")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}")
.asString();
const data = JSON.stringify({
groupId: '',
appId: '',
instanceId: '',
coverage: [
{
classname: '',
testId: '',
testSessionId: '',
probes: []
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/data-ingest/coverage');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/coverage',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
instanceId: '',
coverage: [{classname: '', testId: '', testSessionId: '', probes: []}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/coverage';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","instanceId":"","coverage":[{"classname":"","testId":"","testSessionId":"","probes":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/coverage',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "groupId": "",\n "appId": "",\n "instanceId": "",\n "coverage": [\n {\n "classname": "",\n "testId": "",\n "testSessionId": "",\n "probes": []\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/coverage")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/coverage',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
groupId: '',
appId: '',
instanceId: '',
coverage: [{classname: '', testId: '', testSessionId: '', probes: []}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/coverage',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
groupId: '',
appId: '',
instanceId: '',
coverage: [{classname: '', testId: '', testSessionId: '', probes: []}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/data-ingest/coverage');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
groupId: '',
appId: '',
instanceId: '',
coverage: [
{
classname: '',
testId: '',
testSessionId: '',
probes: []
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/coverage',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
instanceId: '',
coverage: [{classname: '', testId: '', testSessionId: '', probes: []}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/coverage';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","instanceId":"","coverage":[{"classname":"","testId":"","testSessionId":"","probes":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"groupId": @"",
@"appId": @"",
@"instanceId": @"",
@"coverage": @[ @{ @"classname": @"", @"testId": @"", @"testSessionId": @"", @"probes": @[ ] } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/coverage"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/coverage" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/coverage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'groupId' => '',
'appId' => '',
'instanceId' => '',
'coverage' => [
[
'classname' => '',
'testId' => '',
'testSessionId' => '',
'probes' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/data-ingest/coverage', [
'body' => '{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/coverage');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'groupId' => '',
'appId' => '',
'instanceId' => '',
'coverage' => [
[
'classname' => '',
'testId' => '',
'testSessionId' => '',
'probes' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'groupId' => '',
'appId' => '',
'instanceId' => '',
'coverage' => [
[
'classname' => '',
'testId' => '',
'testSessionId' => '',
'probes' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/coverage');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/coverage' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/coverage' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/api/data-ingest/coverage", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/coverage"
payload = {
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/coverage"
payload <- "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/coverage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/data-ingest/coverage') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"coverage\": [\n {\n \"classname\": \"\",\n \"testId\": \"\",\n \"testSessionId\": \"\",\n \"probes\": []\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/coverage";
let payload = json!({
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": (
json!({
"classname": "",
"testId": "",
"testSessionId": "",
"probes": ()
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/data-ingest/coverage \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}'
echo '{
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
{
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
}
]
}' | \
http POST {{baseUrl}}/api/data-ingest/coverage \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "groupId": "",\n "appId": "",\n "instanceId": "",\n "coverage": [\n {\n "classname": "",\n "testId": "",\n "testSessionId": "",\n "probes": []\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/coverage
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"groupId": "",
"appId": "",
"instanceId": "",
"coverage": [
[
"classname": "",
"testId": "",
"testSessionId": "",
"probes": []
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/coverage")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Save instance data
{{baseUrl}}/api/data-ingest/instances
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/instances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/data-ingest/instances" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:groupId ""
:appId ""
:instanceId ""
:commitSha ""
:buildVersion ""
:envId ""}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/instances"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/instances"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/instances");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/instances"
payload := strings.NewReader("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/data-ingest/instances HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 110
{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/data-ingest/instances")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/instances"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/instances")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/data-ingest/instances")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}")
.asString();
const data = JSON.stringify({
groupId: '',
appId: '',
instanceId: '',
commitSha: '',
buildVersion: '',
envId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/data-ingest/instances');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/instances',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
instanceId: '',
commitSha: '',
buildVersion: '',
envId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/instances';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","instanceId":"","commitSha":"","buildVersion":"","envId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/instances',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "groupId": "",\n "appId": "",\n "instanceId": "",\n "commitSha": "",\n "buildVersion": "",\n "envId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/instances")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/instances',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
groupId: '',
appId: '',
instanceId: '',
commitSha: '',
buildVersion: '',
envId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/instances',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
groupId: '',
appId: '',
instanceId: '',
commitSha: '',
buildVersion: '',
envId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/data-ingest/instances');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
groupId: '',
appId: '',
instanceId: '',
commitSha: '',
buildVersion: '',
envId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/instances',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
instanceId: '',
commitSha: '',
buildVersion: '',
envId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/instances';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","instanceId":"","commitSha":"","buildVersion":"","envId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"groupId": @"",
@"appId": @"",
@"instanceId": @"",
@"commitSha": @"",
@"buildVersion": @"",
@"envId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/instances"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/instances" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'groupId' => '',
'appId' => '',
'instanceId' => '',
'commitSha' => '',
'buildVersion' => '',
'envId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/data-ingest/instances', [
'body' => '{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/instances');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'groupId' => '',
'appId' => '',
'instanceId' => '',
'commitSha' => '',
'buildVersion' => '',
'envId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'groupId' => '',
'appId' => '',
'instanceId' => '',
'commitSha' => '',
'buildVersion' => '',
'envId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/instances');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/instances' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/instances' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/api/data-ingest/instances", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/instances"
payload = {
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/instances"
payload <- "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/data-ingest/instances') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"envId\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/instances";
let payload = json!({
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/data-ingest/instances \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}'
echo '{
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
}' | \
http PUT {{baseUrl}}/api/data-ingest/instances \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "groupId": "",\n "appId": "",\n "instanceId": "",\n "commitSha": "",\n "buildVersion": "",\n "envId": ""\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/instances
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"groupId": "",
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": "",
"envId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/instances")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Save method ignore rule
{{baseUrl}}/api/data-ingest/method-ignore-rules
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/method-ignore-rules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/data-ingest/method-ignore-rules" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:groupId ""
:appId ""
:namePattern ""
:classnamePattern ""
:annotationsPattern ""
:classAnnotationsPattern ""}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/method-ignore-rules"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/method-ignore-rules"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/method-ignore-rules");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/method-ignore-rules"
payload := strings.NewReader("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/data-ingest/method-ignore-rules HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 142
{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/data-ingest/method-ignore-rules")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/method-ignore-rules"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/method-ignore-rules")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/data-ingest/method-ignore-rules")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}")
.asString();
const data = JSON.stringify({
groupId: '',
appId: '',
namePattern: '',
classnamePattern: '',
annotationsPattern: '',
classAnnotationsPattern: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/data-ingest/method-ignore-rules');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
namePattern: '',
classnamePattern: '',
annotationsPattern: '',
classAnnotationsPattern: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/method-ignore-rules';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","namePattern":"","classnamePattern":"","annotationsPattern":"","classAnnotationsPattern":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "groupId": "",\n "appId": "",\n "namePattern": "",\n "classnamePattern": "",\n "annotationsPattern": "",\n "classAnnotationsPattern": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/method-ignore-rules")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/method-ignore-rules',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
groupId: '',
appId: '',
namePattern: '',
classnamePattern: '',
annotationsPattern: '',
classAnnotationsPattern: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
groupId: '',
appId: '',
namePattern: '',
classnamePattern: '',
annotationsPattern: '',
classAnnotationsPattern: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/data-ingest/method-ignore-rules');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
groupId: '',
appId: '',
namePattern: '',
classnamePattern: '',
annotationsPattern: '',
classAnnotationsPattern: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/method-ignore-rules',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
namePattern: '',
classnamePattern: '',
annotationsPattern: '',
classAnnotationsPattern: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/method-ignore-rules';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","namePattern":"","classnamePattern":"","annotationsPattern":"","classAnnotationsPattern":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"groupId": @"",
@"appId": @"",
@"namePattern": @"",
@"classnamePattern": @"",
@"annotationsPattern": @"",
@"classAnnotationsPattern": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/method-ignore-rules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/method-ignore-rules" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/method-ignore-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'groupId' => '',
'appId' => '',
'namePattern' => '',
'classnamePattern' => '',
'annotationsPattern' => '',
'classAnnotationsPattern' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/data-ingest/method-ignore-rules', [
'body' => '{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/method-ignore-rules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'groupId' => '',
'appId' => '',
'namePattern' => '',
'classnamePattern' => '',
'annotationsPattern' => '',
'classAnnotationsPattern' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'groupId' => '',
'appId' => '',
'namePattern' => '',
'classnamePattern' => '',
'annotationsPattern' => '',
'classAnnotationsPattern' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/method-ignore-rules');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/method-ignore-rules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/method-ignore-rules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/api/data-ingest/method-ignore-rules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/method-ignore-rules"
payload = {
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/method-ignore-rules"
payload <- "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/method-ignore-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/data-ingest/method-ignore-rules') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"namePattern\": \"\",\n \"classnamePattern\": \"\",\n \"annotationsPattern\": \"\",\n \"classAnnotationsPattern\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/method-ignore-rules";
let payload = json!({
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/data-ingest/method-ignore-rules \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}'
echo '{
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
}' | \
http POST {{baseUrl}}/api/data-ingest/method-ignore-rules \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "groupId": "",\n "appId": "",\n "namePattern": "",\n "classnamePattern": "",\n "annotationsPattern": "",\n "classAnnotationsPattern": ""\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/method-ignore-rules
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"groupId": "",
"appId": "",
"namePattern": "",
"classnamePattern": "",
"annotationsPattern": "",
"classAnnotationsPattern": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/method-ignore-rules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Save methods data
{{baseUrl}}/api/data-ingest/methods
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/methods");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/data-ingest/methods" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:groupId ""
:appId ""
:commitSha ""
:buildVersion ""
:instanceId ""
:methods [{:classname ""
:name ""
:params ""
:returnType ""
:probesCount 0
:probesStartPos 0
:bodyChecksum ""
:annotations {}
:classAnnotations {}}]}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/methods"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/methods"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/methods");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/methods"
payload := strings.NewReader("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/data-ingest/methods HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 343
{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/data-ingest/methods")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/methods"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/methods")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/data-ingest/methods")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}")
.asString();
const data = JSON.stringify({
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
instanceId: '',
methods: [
{
classname: '',
name: '',
params: '',
returnType: '',
probesCount: 0,
probesStartPos: 0,
bodyChecksum: '',
annotations: {},
classAnnotations: {}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/data-ingest/methods');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/methods',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
instanceId: '',
methods: [
{
classname: '',
name: '',
params: '',
returnType: '',
probesCount: 0,
probesStartPos: 0,
bodyChecksum: '',
annotations: {},
classAnnotations: {}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/methods';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","commitSha":"","buildVersion":"","instanceId":"","methods":[{"classname":"","name":"","params":"","returnType":"","probesCount":0,"probesStartPos":0,"bodyChecksum":"","annotations":{},"classAnnotations":{}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/methods',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "groupId": "",\n "appId": "",\n "commitSha": "",\n "buildVersion": "",\n "instanceId": "",\n "methods": [\n {\n "classname": "",\n "name": "",\n "params": "",\n "returnType": "",\n "probesCount": 0,\n "probesStartPos": 0,\n "bodyChecksum": "",\n "annotations": {},\n "classAnnotations": {}\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/methods")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/methods',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
instanceId: '',
methods: [
{
classname: '',
name: '',
params: '',
returnType: '',
probesCount: 0,
probesStartPos: 0,
bodyChecksum: '',
annotations: {},
classAnnotations: {}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/methods',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
instanceId: '',
methods: [
{
classname: '',
name: '',
params: '',
returnType: '',
probesCount: 0,
probesStartPos: 0,
bodyChecksum: '',
annotations: {},
classAnnotations: {}
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/data-ingest/methods');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
instanceId: '',
methods: [
{
classname: '',
name: '',
params: '',
returnType: '',
probesCount: 0,
probesStartPos: 0,
bodyChecksum: '',
annotations: {},
classAnnotations: {}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/methods',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
appId: '',
commitSha: '',
buildVersion: '',
instanceId: '',
methods: [
{
classname: '',
name: '',
params: '',
returnType: '',
probesCount: 0,
probesStartPos: 0,
bodyChecksum: '',
annotations: {},
classAnnotations: {}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/methods';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","appId":"","commitSha":"","buildVersion":"","instanceId":"","methods":[{"classname":"","name":"","params":"","returnType":"","probesCount":0,"probesStartPos":0,"bodyChecksum":"","annotations":{},"classAnnotations":{}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"groupId": @"",
@"appId": @"",
@"commitSha": @"",
@"buildVersion": @"",
@"instanceId": @"",
@"methods": @[ @{ @"classname": @"", @"name": @"", @"params": @"", @"returnType": @"", @"probesCount": @0, @"probesStartPos": @0, @"bodyChecksum": @"", @"annotations": @{ }, @"classAnnotations": @{ } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/methods"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/methods" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'groupId' => '',
'appId' => '',
'commitSha' => '',
'buildVersion' => '',
'instanceId' => '',
'methods' => [
[
'classname' => '',
'name' => '',
'params' => '',
'returnType' => '',
'probesCount' => 0,
'probesStartPos' => 0,
'bodyChecksum' => '',
'annotations' => [
],
'classAnnotations' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/data-ingest/methods', [
'body' => '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/methods');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'groupId' => '',
'appId' => '',
'commitSha' => '',
'buildVersion' => '',
'instanceId' => '',
'methods' => [
[
'classname' => '',
'name' => '',
'params' => '',
'returnType' => '',
'probesCount' => 0,
'probesStartPos' => 0,
'bodyChecksum' => '',
'annotations' => [
],
'classAnnotations' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'groupId' => '',
'appId' => '',
'commitSha' => '',
'buildVersion' => '',
'instanceId' => '',
'methods' => [
[
'classname' => '',
'name' => '',
'params' => '',
'returnType' => '',
'probesCount' => 0,
'probesStartPos' => 0,
'bodyChecksum' => '',
'annotations' => [
],
'classAnnotations' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/methods');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/methods' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/methods' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/api/data-ingest/methods", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/methods"
payload = {
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/methods"
payload <- "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/methods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/data-ingest/methods') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"groupId\": \"\",\n \"appId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\",\n \"instanceId\": \"\",\n \"methods\": [\n {\n \"classname\": \"\",\n \"name\": \"\",\n \"params\": \"\",\n \"returnType\": \"\",\n \"probesCount\": 0,\n \"probesStartPos\": 0,\n \"bodyChecksum\": \"\",\n \"annotations\": {},\n \"classAnnotations\": {}\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/methods";
let payload = json!({
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": (
json!({
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": json!({}),
"classAnnotations": json!({})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/data-ingest/methods \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}'
echo '{
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
{
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": {},
"classAnnotations": {}
}
]
}' | \
http PUT {{baseUrl}}/api/data-ingest/methods \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "groupId": "",\n "appId": "",\n "commitSha": "",\n "buildVersion": "",\n "instanceId": "",\n "methods": [\n {\n "classname": "",\n "name": "",\n "params": "",\n "returnType": "",\n "probesCount": 0,\n "probesStartPos": 0,\n "bodyChecksum": "",\n "annotations": {},\n "classAnnotations": {}\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/methods
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"groupId": "",
"appId": "",
"commitSha": "",
"buildVersion": "",
"instanceId": "",
"methods": [
[
"classname": "",
"name": "",
"params": "",
"returnType": "",
"probesCount": 0,
"probesStartPos": 0,
"bodyChecksum": "",
"annotations": [],
"classAnnotations": []
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/methods")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Save test metadata
{{baseUrl}}/api/data-ingest/tests-metadata
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/tests-metadata");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/data-ingest/tests-metadata" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:groupId ""
:sessionId ""
:tests [{:testLaunchId ""
:testDefinitionId ""
:result ""
:duration 0
:details {:runner ""
:path ""
:testName ""
:testParams []
:metadata {}
:tags []}}]}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/tests-metadata"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/tests-metadata"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/tests-metadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/tests-metadata"
payload := strings.NewReader("{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/data-ingest/tests-metadata HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 327
{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/data-ingest/tests-metadata")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/tests-metadata"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/tests-metadata")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/data-ingest/tests-metadata")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
groupId: '',
sessionId: '',
tests: [
{
testLaunchId: '',
testDefinitionId: '',
result: '',
duration: 0,
details: {
runner: '',
path: '',
testName: '',
testParams: [],
metadata: {},
tags: []
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/data-ingest/tests-metadata');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/tests-metadata',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
sessionId: '',
tests: [
{
testLaunchId: '',
testDefinitionId: '',
result: '',
duration: 0,
details: {runner: '', path: '', testName: '', testParams: [], metadata: {}, tags: []}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/tests-metadata';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","sessionId":"","tests":[{"testLaunchId":"","testDefinitionId":"","result":"","duration":0,"details":{"runner":"","path":"","testName":"","testParams":[],"metadata":{},"tags":[]}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/tests-metadata',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "groupId": "",\n "sessionId": "",\n "tests": [\n {\n "testLaunchId": "",\n "testDefinitionId": "",\n "result": "",\n "duration": 0,\n "details": {\n "runner": "",\n "path": "",\n "testName": "",\n "testParams": [],\n "metadata": {},\n "tags": []\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/tests-metadata")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/tests-metadata',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
groupId: '',
sessionId: '',
tests: [
{
testLaunchId: '',
testDefinitionId: '',
result: '',
duration: 0,
details: {runner: '', path: '', testName: '', testParams: [], metadata: {}, tags: []}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/tests-metadata',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
groupId: '',
sessionId: '',
tests: [
{
testLaunchId: '',
testDefinitionId: '',
result: '',
duration: 0,
details: {runner: '', path: '', testName: '', testParams: [], metadata: {}, tags: []}
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/data-ingest/tests-metadata');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
groupId: '',
sessionId: '',
tests: [
{
testLaunchId: '',
testDefinitionId: '',
result: '',
duration: 0,
details: {
runner: '',
path: '',
testName: '',
testParams: [],
metadata: {},
tags: []
}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/data-ingest/tests-metadata',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
groupId: '',
sessionId: '',
tests: [
{
testLaunchId: '',
testDefinitionId: '',
result: '',
duration: 0,
details: {runner: '', path: '', testName: '', testParams: [], metadata: {}, tags: []}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/tests-metadata';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"groupId":"","sessionId":"","tests":[{"testLaunchId":"","testDefinitionId":"","result":"","duration":0,"details":{"runner":"","path":"","testName":"","testParams":[],"metadata":{},"tags":[]}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"groupId": @"",
@"sessionId": @"",
@"tests": @[ @{ @"testLaunchId": @"", @"testDefinitionId": @"", @"result": @"", @"duration": @0, @"details": @{ @"runner": @"", @"path": @"", @"testName": @"", @"testParams": @[ ], @"metadata": @{ }, @"tags": @[ ] } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/tests-metadata"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/tests-metadata" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/tests-metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'groupId' => '',
'sessionId' => '',
'tests' => [
[
'testLaunchId' => '',
'testDefinitionId' => '',
'result' => '',
'duration' => 0,
'details' => [
'runner' => '',
'path' => '',
'testName' => '',
'testParams' => [
],
'metadata' => [
],
'tags' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/data-ingest/tests-metadata', [
'body' => '{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/tests-metadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'groupId' => '',
'sessionId' => '',
'tests' => [
[
'testLaunchId' => '',
'testDefinitionId' => '',
'result' => '',
'duration' => 0,
'details' => [
'runner' => '',
'path' => '',
'testName' => '',
'testParams' => [
],
'metadata' => [
],
'tags' => [
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'groupId' => '',
'sessionId' => '',
'tests' => [
[
'testLaunchId' => '',
'testDefinitionId' => '',
'result' => '',
'duration' => 0,
'details' => [
'runner' => '',
'path' => '',
'testName' => '',
'testParams' => [
],
'metadata' => [
],
'tags' => [
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/tests-metadata');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/tests-metadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/tests-metadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/api/data-ingest/tests-metadata", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/tests-metadata"
payload = {
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/tests-metadata"
payload <- "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/tests-metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/api/data-ingest/tests-metadata') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"groupId\": \"\",\n \"sessionId\": \"\",\n \"tests\": [\n {\n \"testLaunchId\": \"\",\n \"testDefinitionId\": \"\",\n \"result\": \"\",\n \"duration\": 0,\n \"details\": {\n \"runner\": \"\",\n \"path\": \"\",\n \"testName\": \"\",\n \"testParams\": [],\n \"metadata\": {},\n \"tags\": []\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/tests-metadata";
let payload = json!({
"groupId": "",
"sessionId": "",
"tests": (
json!({
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": json!({
"runner": "",
"path": "",
"testName": "",
"testParams": (),
"metadata": json!({}),
"tags": ()
})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/data-ingest/tests-metadata \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}'
echo '{
"groupId": "",
"sessionId": "",
"tests": [
{
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": {
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": {},
"tags": []
}
}
]
}' | \
http POST {{baseUrl}}/api/data-ingest/tests-metadata \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "groupId": "",\n "sessionId": "",\n "tests": [\n {\n "testLaunchId": "",\n "testDefinitionId": "",\n "result": "",\n "duration": 0,\n "details": {\n "runner": "",\n "path": "",\n "testName": "",\n "testParams": [],\n "metadata": {},\n "tags": []\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/tests-metadata
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"groupId": "",
"sessionId": "",
"tests": [
[
"testLaunchId": "",
"testDefinitionId": "",
"result": "",
"duration": 0,
"details": [
"runner": "",
"path": "",
"testName": "",
"testParams": [],
"metadata": [],
"tags": []
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/tests-metadata")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Save test sessions
{{baseUrl}}/api/data-ingest/sessions
HEADERS
X-API-KEY
{{apiKey}}
BODY json
{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/data-ingest/sessions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/data-ingest/sessions" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:id ""
:groupId ""
:testTaskId ""
:startedAt ""
:builds [{:appId ""
:instanceId ""
:commitSha ""
:buildVersion ""}]}})
require "http/client"
url = "{{baseUrl}}/api/data-ingest/sessions"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/data-ingest/sessions"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/data-ingest/sessions");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/data-ingest/sessions"
payload := strings.NewReader("{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/data-ingest/sessions HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 192
{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/data-ingest/sessions")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/data-ingest/sessions"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/data-ingest/sessions")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/data-ingest/sessions")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
id: '',
groupId: '',
testTaskId: '',
startedAt: '',
builds: [
{
appId: '',
instanceId: '',
commitSha: '',
buildVersion: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/data-ingest/sessions');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/sessions',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
id: '',
groupId: '',
testTaskId: '',
startedAt: '',
builds: [{appId: '', instanceId: '', commitSha: '', buildVersion: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/data-ingest/sessions';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":"","groupId":"","testTaskId":"","startedAt":"","builds":[{"appId":"","instanceId":"","commitSha":"","buildVersion":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/data-ingest/sessions',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "groupId": "",\n "testTaskId": "",\n "startedAt": "",\n "builds": [\n {\n "appId": "",\n "instanceId": "",\n "commitSha": "",\n "buildVersion": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/data-ingest/sessions")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/data-ingest/sessions',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
id: '',
groupId: '',
testTaskId: '',
startedAt: '',
builds: [{appId: '', instanceId: '', commitSha: '', buildVersion: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/sessions',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
id: '',
groupId: '',
testTaskId: '',
startedAt: '',
builds: [{appId: '', instanceId: '', commitSha: '', buildVersion: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/data-ingest/sessions');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
groupId: '',
testTaskId: '',
startedAt: '',
builds: [
{
appId: '',
instanceId: '',
commitSha: '',
buildVersion: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/data-ingest/sessions',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
id: '',
groupId: '',
testTaskId: '',
startedAt: '',
builds: [{appId: '', instanceId: '', commitSha: '', buildVersion: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/data-ingest/sessions';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"id":"","groupId":"","testTaskId":"","startedAt":"","builds":[{"appId":"","instanceId":"","commitSha":"","buildVersion":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"id": @"",
@"groupId": @"",
@"testTaskId": @"",
@"startedAt": @"",
@"builds": @[ @{ @"appId": @"", @"instanceId": @"", @"commitSha": @"", @"buildVersion": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/data-ingest/sessions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/data-ingest/sessions" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/data-ingest/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'groupId' => '',
'testTaskId' => '',
'startedAt' => '',
'builds' => [
[
'appId' => '',
'instanceId' => '',
'commitSha' => '',
'buildVersion' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/data-ingest/sessions', [
'body' => '{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/data-ingest/sessions');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'groupId' => '',
'testTaskId' => '',
'startedAt' => '',
'builds' => [
[
'appId' => '',
'instanceId' => '',
'commitSha' => '',
'buildVersion' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'groupId' => '',
'testTaskId' => '',
'startedAt' => '',
'builds' => [
[
'appId' => '',
'instanceId' => '',
'commitSha' => '',
'buildVersion' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/api/data-ingest/sessions');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/data-ingest/sessions' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/data-ingest/sessions' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/api/data-ingest/sessions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/data-ingest/sessions"
payload = {
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/data-ingest/sessions"
payload <- "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/data-ingest/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/data-ingest/sessions') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"id\": \"\",\n \"groupId\": \"\",\n \"testTaskId\": \"\",\n \"startedAt\": \"\",\n \"builds\": [\n {\n \"appId\": \"\",\n \"instanceId\": \"\",\n \"commitSha\": \"\",\n \"buildVersion\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/data-ingest/sessions";
let payload = json!({
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": (
json!({
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/data-ingest/sessions \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}'
echo '{
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
{
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
}
]
}' | \
http PUT {{baseUrl}}/api/data-ingest/sessions \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "groupId": "",\n "testTaskId": "",\n "startedAt": "",\n "builds": [\n {\n "appId": "",\n "instanceId": "",\n "commitSha": "",\n "buildVersion": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/api/data-ingest/sessions
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"id": "",
"groupId": "",
"testTaskId": "",
"startedAt": "",
"builds": [
[
"appId": "",
"instanceId": "",
"commitSha": "",
"buildVersion": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/data-ingest/sessions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get applications
{{baseUrl}}/api/metrics/applications
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/applications");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/applications" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/metrics/applications"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/applications"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/applications");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/applications"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/applications HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/applications")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/applications"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/applications")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/applications")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/applications');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/applications',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/applications';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/applications',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/applications")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/applications',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/applications',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/applications');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/applications',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/applications';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/applications"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/applications" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/applications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/applications', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/applications');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/applications');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/applications' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/applications' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/applications", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/applications"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/applications"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/applications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/applications') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/applications";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/metrics/applications \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/metrics/applications \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/metrics/applications
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/applications")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get build diff report
{{baseUrl}}/api/metrics/build-diff-report
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/build-diff-report" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:groupId ""
:appId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/build-diff-report?groupId=&appId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/build-diff-report',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/build-diff-report?groupId=&appId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/build-diff-report',
qs: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/build-diff-report');
req.query({
groupId: '',
appId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/build-diff-report',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/build-diff-report');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'groupId' => '',
'appId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/build-diff-report');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'groupId' => '',
'appId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/build-diff-report?groupId=&appId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/build-diff-report"
querystring = {"groupId":"","appId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/build-diff-report"
queryString <- list(
groupId = "",
appId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/build-diff-report') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['groupId'] = ''
req.params['appId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/build-diff-report";
let querystring = [
("groupId", ""),
("appId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/build-diff-report?groupId=&appId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get builds
{{baseUrl}}/api/metrics/builds
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/builds?groupId=&appId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/builds" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:groupId ""
:appId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/builds?groupId=&appId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/builds?groupId=&appId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/builds?groupId=&appId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/builds?groupId=&appId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/builds?groupId=&appId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/builds?groupId=&appId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/builds?groupId=&appId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/builds?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/builds?groupId=&appId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/builds?groupId=&appId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/builds',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/builds?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/builds?groupId=&appId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/builds?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/builds?groupId=&appId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/builds',
qs: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/builds');
req.query({
groupId: '',
appId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/builds',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/builds?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/builds?groupId=&appId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/builds?groupId=&appId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/builds?groupId=&appId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/builds?groupId=&appId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/builds');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'groupId' => '',
'appId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/builds');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'groupId' => '',
'appId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/builds?groupId=&appId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/builds?groupId=&appId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/builds?groupId=&appId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/builds"
querystring = {"groupId":"","appId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/builds"
queryString <- list(
groupId = "",
appId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/builds?groupId=&appId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/builds') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['groupId'] = ''
req.params['appId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/builds";
let querystring = [
("groupId", ""),
("appId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/builds?groupId=&appId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/builds?groupId=&appId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/builds?groupId=&appId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/builds?groupId=&appId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get changes coverage treemap
{{baseUrl}}/api/metrics/changes-coverage-treemap
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
buildId
baselineBuildId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/changes-coverage-treemap" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:buildId ""
:baselineBuildId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/changes-coverage-treemap',
params: {buildId: '', baselineBuildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/changes-coverage-treemap',
qs: {buildId: '', baselineBuildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/changes-coverage-treemap');
req.query({
buildId: '',
baselineBuildId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/changes-coverage-treemap',
params: {buildId: '', baselineBuildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/changes-coverage-treemap');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'buildId' => '',
'baselineBuildId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/changes-coverage-treemap');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'buildId' => '',
'baselineBuildId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/changes-coverage-treemap"
querystring = {"buildId":"","baselineBuildId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/changes-coverage-treemap"
queryString <- list(
buildId = "",
baselineBuildId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/changes-coverage-treemap') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['buildId'] = ''
req.params['baselineBuildId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/changes-coverage-treemap";
let querystring = [
("buildId", ""),
("baselineBuildId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/changes-coverage-treemap?buildId=&baselineBuildId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get coverage by methods for a build
{{baseUrl}}/api/metrics/coverage
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
buildId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/coverage?buildId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/coverage" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:buildId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/coverage?buildId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/coverage?buildId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/coverage?buildId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/coverage?buildId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/coverage?buildId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/coverage?buildId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/coverage?buildId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/coverage?buildId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/coverage?buildId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/coverage?buildId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/coverage',
params: {buildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/coverage?buildId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/coverage?buildId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/coverage?buildId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/coverage?buildId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/coverage',
qs: {buildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/coverage');
req.query({
buildId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/coverage',
params: {buildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/coverage?buildId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/coverage?buildId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/coverage?buildId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/coverage?buildId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/coverage?buildId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/coverage');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'buildId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/coverage');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'buildId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/coverage?buildId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/coverage?buildId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/coverage?buildId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/coverage"
querystring = {"buildId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/coverage"
queryString <- list(buildId = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/coverage?buildId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/coverage') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['buildId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/coverage";
let querystring = [
("buildId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/coverage?buildId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/coverage?buildId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/coverage?buildId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/coverage?buildId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get coverage treemap
{{baseUrl}}/api/metrics/coverage-treemap
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
buildId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/coverage-treemap?buildId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/coverage-treemap" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:buildId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/coverage-treemap?buildId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/coverage-treemap?buildId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/coverage-treemap?buildId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/coverage-treemap?buildId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/coverage-treemap?buildId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/coverage-treemap?buildId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/coverage-treemap?buildId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/coverage-treemap?buildId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/coverage-treemap?buildId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/coverage-treemap?buildId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/coverage-treemap',
params: {buildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/coverage-treemap?buildId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/coverage-treemap?buildId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/coverage-treemap?buildId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/coverage-treemap?buildId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/coverage-treemap',
qs: {buildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/coverage-treemap');
req.query({
buildId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/coverage-treemap',
params: {buildId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/coverage-treemap?buildId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/coverage-treemap?buildId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/coverage-treemap?buildId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/coverage-treemap?buildId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/coverage-treemap?buildId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/coverage-treemap');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'buildId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/coverage-treemap');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'buildId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/coverage-treemap?buildId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/coverage-treemap?buildId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/coverage-treemap?buildId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/coverage-treemap"
querystring = {"buildId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/coverage-treemap"
queryString <- list(buildId = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/coverage-treemap?buildId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/coverage-treemap') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['buildId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/coverage-treemap";
let querystring = [
("buildId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/coverage-treemap?buildId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/coverage-treemap?buildId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/coverage-treemap?buildId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/coverage-treemap?buildId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get impacted methods
{{baseUrl}}/api/metrics/impacted-methods
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/impacted-methods" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:groupId ""
:appId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/impacted-methods?groupId=&appId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/impacted-methods',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/impacted-methods?groupId=&appId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/impacted-methods',
qs: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/impacted-methods');
req.query({
groupId: '',
appId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/impacted-methods',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/impacted-methods');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'groupId' => '',
'appId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/impacted-methods');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'groupId' => '',
'appId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/impacted-methods?groupId=&appId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/impacted-methods"
querystring = {"groupId":"","appId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/impacted-methods"
queryString <- list(
groupId = "",
appId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/impacted-methods') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['groupId'] = ''
req.params['appId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/impacted-methods";
let querystring = [
("groupId", ""),
("appId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/impacted-methods?groupId=&appId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get impacted tests
{{baseUrl}}/api/metrics/impacted-tests
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/impacted-tests" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:groupId ""
:appId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/impacted-tests?groupId=&appId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/impacted-tests',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/impacted-tests?groupId=&appId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/impacted-tests',
qs: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/impacted-tests');
req.query({
groupId: '',
appId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/impacted-tests',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/impacted-tests');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'groupId' => '',
'appId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/impacted-tests');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'groupId' => '',
'appId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/impacted-tests?groupId=&appId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/impacted-tests"
querystring = {"groupId":"","appId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/impacted-tests"
queryString <- list(
groupId = "",
appId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/impacted-tests') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['groupId'] = ''
req.params['appId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/impacted-tests";
let querystring = [
("groupId", ""),
("appId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/impacted-tests?groupId=&appId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get method changes between builds
{{baseUrl}}/api/metrics/changes
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/changes?groupId=&appId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/changes" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:groupId ""
:appId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/changes?groupId=&appId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/changes?groupId=&appId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/changes?groupId=&appId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/changes?groupId=&appId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/changes?groupId=&appId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/changes?groupId=&appId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/changes?groupId=&appId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/changes?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/changes?groupId=&appId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/changes?groupId=&appId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/changes',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/changes?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/changes?groupId=&appId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/changes?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/changes?groupId=&appId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/changes',
qs: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/changes');
req.query({
groupId: '',
appId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/changes',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/changes?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/changes?groupId=&appId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/changes?groupId=&appId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/changes?groupId=&appId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/changes?groupId=&appId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/changes');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'groupId' => '',
'appId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/changes');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'groupId' => '',
'appId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/changes?groupId=&appId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/changes?groupId=&appId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/changes?groupId=&appId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/changes"
querystring = {"groupId":"","appId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/changes"
queryString <- list(
groupId = "",
appId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/changes?groupId=&appId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/changes') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['groupId'] = ''
req.params['appId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/changes";
let querystring = [
("groupId", ""),
("appId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/changes?groupId=&appId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/changes?groupId=&appId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/changes?groupId=&appId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/changes?groupId=&appId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get recommended tests
{{baseUrl}}/api/metrics/recommended-tests
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
appId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/metrics/recommended-tests" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:groupId ""
:appId ""}})
require "http/client"
url = "{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/metrics/recommended-tests?groupId=&appId= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/recommended-tests',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/recommended-tests?groupId=&appId=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/recommended-tests',
qs: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/metrics/recommended-tests');
req.query({
groupId: '',
appId: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/metrics/recommended-tests',
params: {groupId: '', appId: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/recommended-tests');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'groupId' => '',
'appId' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/recommended-tests');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'groupId' => '',
'appId' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/metrics/recommended-tests?groupId=&appId=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/recommended-tests"
querystring = {"groupId":"","appId":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/recommended-tests"
queryString <- list(
groupId = "",
appId = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/metrics/recommended-tests') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['groupId'] = ''
req.params['appId'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/recommended-tests";
let querystring = [
("groupId", ""),
("appId", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/recommended-tests?groupId=&appId=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Refresh materialized views
{{baseUrl}}/api/metrics/refresh
HEADERS
X-API-KEY
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/metrics/refresh");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/metrics/refresh" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/metrics/refresh"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/metrics/refresh"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/metrics/refresh");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/metrics/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/metrics/refresh HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/metrics/refresh")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/metrics/refresh"))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/metrics/refresh")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/metrics/refresh")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/metrics/refresh');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/metrics/refresh',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/metrics/refresh';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/metrics/refresh',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/metrics/refresh")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/metrics/refresh',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/metrics/refresh',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/metrics/refresh');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/metrics/refresh',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/metrics/refresh';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/metrics/refresh"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/metrics/refresh" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/metrics/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/metrics/refresh', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/metrics/refresh');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/metrics/refresh');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/metrics/refresh' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/metrics/refresh' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/api/metrics/refresh", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/metrics/refresh"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/metrics/refresh"
response <- VERB("POST", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/metrics/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/api/metrics/refresh') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/metrics/refresh";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/api/metrics/refresh \
--header 'x-api-key: {{apiKey}}'
http POST {{baseUrl}}/api/metrics/refresh \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/metrics/refresh
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/metrics/refresh")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete group settings
{{baseUrl}}/api/group-settings/:groupId
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/group-settings/:groupId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/api/group-settings/:groupId" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/group-settings/:groupId"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/api/group-settings/:groupId"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/group-settings/:groupId");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/group-settings/:groupId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/api/group-settings/:groupId HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/api/group-settings/:groupId")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/group-settings/:groupId"))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/group-settings/:groupId")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/api/group-settings/:groupId")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/api/group-settings/:groupId');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/group-settings/:groupId';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/group-settings/:groupId',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/group-settings/:groupId")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/group-settings/:groupId',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/api/group-settings/:groupId');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/group-settings/:groupId';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/group-settings/:groupId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/group-settings/:groupId" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/group-settings/:groupId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/api/group-settings/:groupId', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/group-settings/:groupId');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/group-settings/:groupId');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/group-settings/:groupId' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/group-settings/:groupId' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/api/group-settings/:groupId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/group-settings/:groupId"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/group-settings/:groupId"
response <- VERB("DELETE", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/group-settings/:groupId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/api/group-settings/:groupId') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/group-settings/:groupId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/api/group-settings/:groupId \
--header 'x-api-key: {{apiKey}}'
http DELETE {{baseUrl}}/api/group-settings/:groupId \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/group-settings/:groupId
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/group-settings/:groupId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get group settings
{{baseUrl}}/api/group-settings/:groupId
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/group-settings/:groupId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/api/group-settings/:groupId" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/api/group-settings/:groupId"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/api/group-settings/:groupId"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/group-settings/:groupId");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/group-settings/:groupId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/api/group-settings/:groupId HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/api/group-settings/:groupId")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/group-settings/:groupId"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/api/group-settings/:groupId")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/api/group-settings/:groupId")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/api/group-settings/:groupId');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/group-settings/:groupId';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/group-settings/:groupId',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/api/group-settings/:groupId")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/group-settings/:groupId',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/api/group-settings/:groupId');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/group-settings/:groupId';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/group-settings/:groupId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/group-settings/:groupId" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/group-settings/:groupId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/api/group-settings/:groupId', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/group-settings/:groupId');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/api/group-settings/:groupId');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/group-settings/:groupId' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/group-settings/:groupId' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/api/group-settings/:groupId", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/group-settings/:groupId"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/group-settings/:groupId"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/group-settings/:groupId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/api/group-settings/:groupId') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/group-settings/:groupId";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/api/group-settings/:groupId \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/api/group-settings/:groupId \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/api/group-settings/:groupId
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/group-settings/:groupId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Save group settings
{{baseUrl}}/api/group-settings/:groupId
HEADERS
X-API-KEY
{{apiKey}}
QUERY PARAMS
groupId
BODY json
{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/group-settings/:groupId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/api/group-settings/:groupId" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:retentionPeriodDays 0
:metricsPeriodDays 0}})
require "http/client"
url = "{{baseUrl}}/api/group-settings/:groupId"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/api/group-settings/:groupId"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/group-settings/:groupId");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/group-settings/:groupId"
payload := strings.NewReader("{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/api/group-settings/:groupId HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/api/group-settings/:groupId")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/group-settings/:groupId"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/group-settings/:groupId")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/api/group-settings/:groupId")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}")
.asString();
const data = JSON.stringify({
retentionPeriodDays: 0,
metricsPeriodDays: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/api/group-settings/:groupId');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {retentionPeriodDays: 0, metricsPeriodDays: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/group-settings/:groupId';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"retentionPeriodDays":0,"metricsPeriodDays":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/group-settings/:groupId',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "retentionPeriodDays": 0,\n "metricsPeriodDays": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/group-settings/:groupId")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/group-settings/:groupId',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({retentionPeriodDays: 0, metricsPeriodDays: 0}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {retentionPeriodDays: 0, metricsPeriodDays: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/api/group-settings/:groupId');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
retentionPeriodDays: 0,
metricsPeriodDays: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/api/group-settings/:groupId',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {retentionPeriodDays: 0, metricsPeriodDays: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/group-settings/:groupId';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"retentionPeriodDays":0,"metricsPeriodDays":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"retentionPeriodDays": @0,
@"metricsPeriodDays": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/group-settings/:groupId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/group-settings/:groupId" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/group-settings/:groupId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'retentionPeriodDays' => 0,
'metricsPeriodDays' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/api/group-settings/:groupId', [
'body' => '{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/group-settings/:groupId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'retentionPeriodDays' => 0,
'metricsPeriodDays' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'retentionPeriodDays' => 0,
'metricsPeriodDays' => 0
]));
$request->setRequestUrl('{{baseUrl}}/api/group-settings/:groupId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/group-settings/:groupId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/group-settings/:groupId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/api/group-settings/:groupId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/group-settings/:groupId"
payload = {
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/group-settings/:groupId"
payload <- "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/group-settings/:groupId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/api/group-settings/:groupId') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"retentionPeriodDays\": 0,\n \"metricsPeriodDays\": 0\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/group-settings/:groupId";
let payload = json!({
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/api/group-settings/:groupId \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}'
echo '{
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
}' | \
http PUT {{baseUrl}}/api/group-settings/:groupId \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "retentionPeriodDays": 0,\n "metricsPeriodDays": 0\n}' \
--output-document \
- {{baseUrl}}/api/group-settings/:groupId
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"retentionPeriodDays": 0,
"metricsPeriodDays": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/group-settings/:groupId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()