Probely Developers
POST
Action that should be taken to enable the selected targets
{{baseUrl}}/billing/actions/
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/billing/actions/");
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 \"jMXUw-BE_2vd\"\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/billing/actions/" {:content-type :json
:form-params ["jMXUw-BE_2vd"]})
require "http/client"
url = "{{baseUrl}}/billing/actions/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n \"jMXUw-BE_2vd\"\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}}/billing/actions/"),
Content = new StringContent("[\n \"jMXUw-BE_2vd\"\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}}/billing/actions/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n \"jMXUw-BE_2vd\"\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/billing/actions/"
payload := strings.NewReader("[\n \"jMXUw-BE_2vd\"\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/billing/actions/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
[
"jMXUw-BE_2vd"
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/billing/actions/")
.setHeader("content-type", "application/json")
.setBody("[\n \"jMXUw-BE_2vd\"\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/billing/actions/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n \"jMXUw-BE_2vd\"\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 \"jMXUw-BE_2vd\"\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/billing/actions/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/billing/actions/")
.header("content-type", "application/json")
.body("[\n \"jMXUw-BE_2vd\"\n]")
.asString();
const data = JSON.stringify([
'jMXUw-BE_2vd'
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/billing/actions/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/billing/actions/',
headers: {'content-type': 'application/json'},
data: ['jMXUw-BE_2vd']
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/billing/actions/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '["jMXUw-BE_2vd"]'
};
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}}/billing/actions/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n "jMXUw-BE_2vd"\n]'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "[\n \"jMXUw-BE_2vd\"\n]")
val request = Request.Builder()
.url("{{baseUrl}}/billing/actions/")
.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/billing/actions/',
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(['jMXUw-BE_2vd']));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/billing/actions/',
headers: {'content-type': 'application/json'},
body: ['jMXUw-BE_2vd'],
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}}/billing/actions/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
'jMXUw-BE_2vd'
]);
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}}/billing/actions/',
headers: {'content-type': 'application/json'},
data: ['jMXUw-BE_2vd']
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/billing/actions/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '["jMXUw-BE_2vd"]'
};
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 = @[ @"jMXUw-BE_2vd" ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/billing/actions/"]
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}}/billing/actions/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n \"jMXUw-BE_2vd\"\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/billing/actions/",
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([
'jMXUw-BE_2vd'
]),
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}}/billing/actions/', [
'body' => '[
"jMXUw-BE_2vd"
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/billing/actions/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'jMXUw-BE_2vd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'jMXUw-BE_2vd'
]));
$request->setRequestUrl('{{baseUrl}}/billing/actions/');
$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}}/billing/actions/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
"jMXUw-BE_2vd"
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/billing/actions/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
"jMXUw-BE_2vd"
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n \"jMXUw-BE_2vd\"\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/billing/actions/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/billing/actions/"
payload = ["jMXUw-BE_2vd"]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/billing/actions/"
payload <- "[\n \"jMXUw-BE_2vd\"\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}}/billing/actions/")
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 \"jMXUw-BE_2vd\"\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/billing/actions/') do |req|
req.body = "[\n \"jMXUw-BE_2vd\"\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/billing/actions/";
let payload = ("jMXUw-BE_2vd");
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}}/billing/actions/ \
--header 'content-type: application/json' \
--data '[
"jMXUw-BE_2vd"
]'
echo '[
"jMXUw-BE_2vd"
]' | \
http POST {{baseUrl}}/billing/actions/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n "jMXUw-BE_2vd"\n]' \
--output-document \
- {{baseUrl}}/billing/actions/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["jMXUw-BE_2vd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/billing/actions/")! 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
Available actions for the selected targets
{{baseUrl}}/target-actions/
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/target-actions/");
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 \"jMXUw-BE_2vd\"\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/target-actions/" {:content-type :json
:form-params ["jMXUw-BE_2vd"]})
require "http/client"
url = "{{baseUrl}}/target-actions/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\n \"jMXUw-BE_2vd\"\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}}/target-actions/"),
Content = new StringContent("[\n \"jMXUw-BE_2vd\"\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}}/target-actions/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n \"jMXUw-BE_2vd\"\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/target-actions/"
payload := strings.NewReader("[\n \"jMXUw-BE_2vd\"\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/target-actions/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
[
"jMXUw-BE_2vd"
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/target-actions/")
.setHeader("content-type", "application/json")
.setBody("[\n \"jMXUw-BE_2vd\"\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/target-actions/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n \"jMXUw-BE_2vd\"\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 \"jMXUw-BE_2vd\"\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/target-actions/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/target-actions/")
.header("content-type", "application/json")
.body("[\n \"jMXUw-BE_2vd\"\n]")
.asString();
const data = JSON.stringify([
'jMXUw-BE_2vd'
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/target-actions/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/target-actions/',
headers: {'content-type': 'application/json'},
data: ['jMXUw-BE_2vd']
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/target-actions/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '["jMXUw-BE_2vd"]'
};
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}}/target-actions/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\n "jMXUw-BE_2vd"\n]'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "[\n \"jMXUw-BE_2vd\"\n]")
val request = Request.Builder()
.url("{{baseUrl}}/target-actions/")
.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/target-actions/',
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(['jMXUw-BE_2vd']));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/target-actions/',
headers: {'content-type': 'application/json'},
body: ['jMXUw-BE_2vd'],
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}}/target-actions/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
'jMXUw-BE_2vd'
]);
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}}/target-actions/',
headers: {'content-type': 'application/json'},
data: ['jMXUw-BE_2vd']
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/target-actions/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '["jMXUw-BE_2vd"]'
};
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 = @[ @"jMXUw-BE_2vd" ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/target-actions/"]
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}}/target-actions/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n \"jMXUw-BE_2vd\"\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/target-actions/",
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([
'jMXUw-BE_2vd'
]),
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}}/target-actions/', [
'body' => '[
"jMXUw-BE_2vd"
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/target-actions/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'jMXUw-BE_2vd'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'jMXUw-BE_2vd'
]));
$request->setRequestUrl('{{baseUrl}}/target-actions/');
$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}}/target-actions/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
"jMXUw-BE_2vd"
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/target-actions/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
"jMXUw-BE_2vd"
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n \"jMXUw-BE_2vd\"\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/target-actions/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/target-actions/"
payload = ["jMXUw-BE_2vd"]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/target-actions/"
payload <- "[\n \"jMXUw-BE_2vd\"\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}}/target-actions/")
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 \"jMXUw-BE_2vd\"\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/target-actions/') do |req|
req.body = "[\n \"jMXUw-BE_2vd\"\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/target-actions/";
let payload = ("jMXUw-BE_2vd");
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}}/target-actions/ \
--header 'content-type: application/json' \
--data '[
"jMXUw-BE_2vd"
]'
echo '[
"jMXUw-BE_2vd"
]' | \
http POST {{baseUrl}}/target-actions/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n "jMXUw-BE_2vd"\n]' \
--output-document \
- {{baseUrl}}/target-actions/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["jMXUw-BE_2vd"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/target-actions/")! 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
Estimate costs of updating a subscription
{{baseUrl}}/billing/estimate/
BODY json
{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/billing/estimate/");
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 \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/billing/estimate/" {:content-type :json
:form-params {:coupon_ids []
:plan_id ""
:target_ids []}})
require "http/client"
url = "{{baseUrl}}/billing/estimate/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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}}/billing/estimate/"),
Content = new StringContent("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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}}/billing/estimate/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/billing/estimate/"
payload := strings.NewReader("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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/billing/estimate/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/billing/estimate/")
.setHeader("content-type", "application/json")
.setBody("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/billing/estimate/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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 \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/billing/estimate/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/billing/estimate/")
.header("content-type", "application/json")
.body("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}")
.asString();
const data = JSON.stringify({
coupon_ids: [],
plan_id: '',
target_ids: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/billing/estimate/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/billing/estimate/',
headers: {'content-type': 'application/json'},
data: {coupon_ids: [], plan_id: '', target_ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/billing/estimate/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"coupon_ids":[],"plan_id":"","target_ids":[]}'
};
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}}/billing/estimate/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "coupon_ids": [],\n "plan_id": "",\n "target_ids": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/billing/estimate/")
.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/billing/estimate/',
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({coupon_ids: [], plan_id: '', target_ids: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/billing/estimate/',
headers: {'content-type': 'application/json'},
body: {coupon_ids: [], plan_id: '', target_ids: []},
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}}/billing/estimate/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
coupon_ids: [],
plan_id: '',
target_ids: []
});
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}}/billing/estimate/',
headers: {'content-type': 'application/json'},
data: {coupon_ids: [], plan_id: '', target_ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/billing/estimate/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"coupon_ids":[],"plan_id":"","target_ids":[]}'
};
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 = @{ @"coupon_ids": @[ ],
@"plan_id": @"",
@"target_ids": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/billing/estimate/"]
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}}/billing/estimate/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/billing/estimate/",
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([
'coupon_ids' => [
],
'plan_id' => '',
'target_ids' => [
]
]),
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}}/billing/estimate/', [
'body' => '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/billing/estimate/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'coupon_ids' => [
],
'plan_id' => '',
'target_ids' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'coupon_ids' => [
],
'plan_id' => '',
'target_ids' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/billing/estimate/');
$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}}/billing/estimate/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/billing/estimate/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/billing/estimate/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/billing/estimate/"
payload = {
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/billing/estimate/"
payload <- "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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}}/billing/estimate/")
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 \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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/billing/estimate/') do |req|
req.body = "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/billing/estimate/";
let payload = json!({
"coupon_ids": (),
"plan_id": "",
"target_ids": ()
});
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}}/billing/estimate/ \
--header 'content-type: application/json' \
--data '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}'
echo '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}' | \
http POST {{baseUrl}}/billing/estimate/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "coupon_ids": [],\n "plan_id": "",\n "target_ids": []\n}' \
--output-document \
- {{baseUrl}}/billing/estimate/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"coupon_ids": [],
"plan_id": "",
"target_ids": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/billing/estimate/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"currency_code": "EUR",
"plan_id": "jMXUw-BE_2vd"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update billing information
{{baseUrl}}/billing/
BODY json
{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/billing/");
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 \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/billing/" {:content-type :json
:form-params {:address ""
:city ""
:country ""
:email ""
:first_name ""
:last_name ""
:other ""
:reg_number ""
:vat_number ""
:zip ""}})
require "http/client"
url = "{{baseUrl}}/billing/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/billing/"),
Content = new StringContent("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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}}/billing/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/billing/"
payload := strings.NewReader("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/billing/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 172
{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/billing/")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/billing/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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 \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/billing/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/billing/")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/billing/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/billing/',
headers: {'content-type': 'application/json'},
data: {
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/billing/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"address":"","city":"","country":"","email":"","first_name":"","last_name":"","other":"","reg_number":"","vat_number":"","zip":""}'
};
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}}/billing/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "city": "",\n "country": "",\n "email": "",\n "first_name": "",\n "last_name": "",\n "other": "",\n "reg_number": "",\n "vat_number": "",\n "zip": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/billing/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/billing/',
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({
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/billing/',
headers: {'content-type': 'application/json'},
body: {
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/billing/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
});
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}}/billing/',
headers: {'content-type': 'application/json'},
data: {
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/billing/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"address":"","city":"","country":"","email":"","first_name":"","last_name":"","other":"","reg_number":"","vat_number":"","zip":""}'
};
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 = @{ @"address": @"",
@"city": @"",
@"country": @"",
@"email": @"",
@"first_name": @"",
@"last_name": @"",
@"other": @"",
@"reg_number": @"",
@"vat_number": @"",
@"zip": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/billing/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/billing/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/billing/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'address' => '',
'city' => '',
'country' => '',
'email' => '',
'first_name' => '',
'last_name' => '',
'other' => '',
'reg_number' => '',
'vat_number' => '',
'zip' => ''
]),
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('PATCH', '{{baseUrl}}/billing/', [
'body' => '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/billing/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'city' => '',
'country' => '',
'email' => '',
'first_name' => '',
'last_name' => '',
'other' => '',
'reg_number' => '',
'vat_number' => '',
'zip' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'city' => '',
'country' => '',
'email' => '',
'first_name' => '',
'last_name' => '',
'other' => '',
'reg_number' => '',
'vat_number' => '',
'zip' => ''
]));
$request->setRequestUrl('{{baseUrl}}/billing/');
$request->setRequestMethod('PATCH');
$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}}/billing/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/billing/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/billing/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/billing/"
payload = {
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/billing/"
payload <- "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/billing/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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.patch('/baseUrl/billing/') do |req|
req.body = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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}}/billing/";
let payload = json!({
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/billing/ \
--header 'content-type: application/json' \
--data '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}'
echo '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}' | \
http PATCH {{baseUrl}}/billing/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "city": "",\n "country": "",\n "email": "",\n "first_name": "",\n "last_name": "",\n "other": "",\n "reg_number": "",\n "vat_number": "",\n "zip": ""\n}' \
--output-document \
- {{baseUrl}}/billing/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/billing/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"city": "Munich",
"country": "DE"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve account information
{{baseUrl}}/account/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/account/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/account/")
require "http/client"
url = "{{baseUrl}}/account/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/account/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/account/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/account/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/account/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/account/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/account/"))
.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}}/account/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/account/")
.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}}/account/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/account/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/account/';
const options = {method: 'GET'};
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}}/account/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/account/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/account/',
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: 'GET', url: '{{baseUrl}}/account/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/account/');
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}}/account/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/account/';
const options = {method: 'GET'};
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}}/account/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/account/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/account/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/account/');
echo $response->getBody();
setUrl('{{baseUrl}}/account/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/account/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/account/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/account/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/account/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/account/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/account/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/account/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/account/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/account/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/account/
http GET {{baseUrl}}/account/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/account/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/account/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"auto_collection": "on",
"balance": 0,
"balance_currency_code": "EUR",
"free_target_quantity": 3,
"has_used_trial": true,
"next_billing_at": "2018-01-31T16:32:17.238553Z",
"plan": {
"charge_model": "per_unit",
"currency_code": "EUR",
"description": "Object description",
"id": "jMXUw-BE_2vd",
"is_trial": false,
"name": "Object name",
"period": 1,
"price": 5000
},
"plan_target_quantity": 3,
"pool_size": 5,
"status": "active",
"trialEnd": "2018-01-31T16:32:52.226652Z"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve billing information
{{baseUrl}}/billing/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/billing/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/billing/")
require "http/client"
url = "{{baseUrl}}/billing/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/billing/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/billing/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/billing/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/billing/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/billing/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/billing/"))
.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}}/billing/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/billing/")
.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}}/billing/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/billing/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/billing/';
const options = {method: 'GET'};
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}}/billing/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/billing/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/billing/',
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: 'GET', url: '{{baseUrl}}/billing/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/billing/');
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}}/billing/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/billing/';
const options = {method: 'GET'};
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}}/billing/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/billing/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/billing/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/billing/');
echo $response->getBody();
setUrl('{{baseUrl}}/billing/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/billing/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/billing/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/billing/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/billing/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/billing/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/billing/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/billing/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/billing/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/billing/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/billing/
http GET {{baseUrl}}/billing/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/billing/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/billing/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"city": "Munich",
"country": "DE"
}
POST
Update a subscription
{{baseUrl}}/billing/subscribe/
BODY json
{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/billing/subscribe/");
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 \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/billing/subscribe/" {:content-type :json
:form-params {:coupon_ids []
:plan_id ""
:target_ids []}})
require "http/client"
url = "{{baseUrl}}/billing/subscribe/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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}}/billing/subscribe/"),
Content = new StringContent("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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}}/billing/subscribe/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/billing/subscribe/"
payload := strings.NewReader("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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/billing/subscribe/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/billing/subscribe/")
.setHeader("content-type", "application/json")
.setBody("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/billing/subscribe/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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 \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/billing/subscribe/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/billing/subscribe/")
.header("content-type", "application/json")
.body("{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}")
.asString();
const data = JSON.stringify({
coupon_ids: [],
plan_id: '',
target_ids: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/billing/subscribe/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/billing/subscribe/',
headers: {'content-type': 'application/json'},
data: {coupon_ids: [], plan_id: '', target_ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/billing/subscribe/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"coupon_ids":[],"plan_id":"","target_ids":[]}'
};
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}}/billing/subscribe/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "coupon_ids": [],\n "plan_id": "",\n "target_ids": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/billing/subscribe/")
.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/billing/subscribe/',
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({coupon_ids: [], plan_id: '', target_ids: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/billing/subscribe/',
headers: {'content-type': 'application/json'},
body: {coupon_ids: [], plan_id: '', target_ids: []},
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}}/billing/subscribe/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
coupon_ids: [],
plan_id: '',
target_ids: []
});
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}}/billing/subscribe/',
headers: {'content-type': 'application/json'},
data: {coupon_ids: [], plan_id: '', target_ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/billing/subscribe/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"coupon_ids":[],"plan_id":"","target_ids":[]}'
};
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 = @{ @"coupon_ids": @[ ],
@"plan_id": @"",
@"target_ids": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/billing/subscribe/"]
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}}/billing/subscribe/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/billing/subscribe/",
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([
'coupon_ids' => [
],
'plan_id' => '',
'target_ids' => [
]
]),
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}}/billing/subscribe/', [
'body' => '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/billing/subscribe/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'coupon_ids' => [
],
'plan_id' => '',
'target_ids' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'coupon_ids' => [
],
'plan_id' => '',
'target_ids' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/billing/subscribe/');
$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}}/billing/subscribe/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/billing/subscribe/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/billing/subscribe/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/billing/subscribe/"
payload = {
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/billing/subscribe/"
payload <- "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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}}/billing/subscribe/")
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 \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\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/billing/subscribe/') do |req|
req.body = "{\n \"coupon_ids\": [],\n \"plan_id\": \"\",\n \"target_ids\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/billing/subscribe/";
let payload = json!({
"coupon_ids": (),
"plan_id": "",
"target_ids": ()
});
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}}/billing/subscribe/ \
--header 'content-type: application/json' \
--data '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}'
echo '{
"coupon_ids": [],
"plan_id": "",
"target_ids": []
}' | \
http POST {{baseUrl}}/billing/subscribe/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "coupon_ids": [],\n "plan_id": "",\n "target_ids": []\n}' \
--output-document \
- {{baseUrl}}/billing/subscribe/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"coupon_ids": [],
"plan_id": "",
"target_ids": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/billing/subscribe/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"currency_code": "EUR",
"plan_id": "jMXUw-BE_2vd"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update billing information
{{baseUrl}}/billing/
BODY json
{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/billing/");
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 \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/billing/" {:content-type :json
:form-params {:address ""
:city ""
:country ""
:email ""
:first_name ""
:last_name ""
:other ""
:reg_number ""
:vat_number ""
:zip ""}})
require "http/client"
url = "{{baseUrl}}/billing/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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}}/billing/"),
Content = new StringContent("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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}}/billing/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/billing/"
payload := strings.NewReader("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/billing/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 172
{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/billing/")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/billing/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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 \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/billing/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/billing/")
.header("content-type", "application/json")
.body("{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/billing/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/billing/',
headers: {'content-type': 'application/json'},
data: {
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/billing/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"address":"","city":"","country":"","email":"","first_name":"","last_name":"","other":"","reg_number":"","vat_number":"","zip":""}'
};
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}}/billing/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": "",\n "city": "",\n "country": "",\n "email": "",\n "first_name": "",\n "last_name": "",\n "other": "",\n "reg_number": "",\n "vat_number": "",\n "zip": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/billing/")
.put(body)
.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/billing/',
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({
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/billing/',
headers: {'content-type': 'application/json'},
body: {
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
},
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}}/billing/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
});
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}}/billing/',
headers: {'content-type': 'application/json'},
data: {
address: '',
city: '',
country: '',
email: '',
first_name: '',
last_name: '',
other: '',
reg_number: '',
vat_number: '',
zip: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/billing/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"address":"","city":"","country":"","email":"","first_name":"","last_name":"","other":"","reg_number":"","vat_number":"","zip":""}'
};
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 = @{ @"address": @"",
@"city": @"",
@"country": @"",
@"email": @"",
@"first_name": @"",
@"last_name": @"",
@"other": @"",
@"reg_number": @"",
@"vat_number": @"",
@"zip": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/billing/"]
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}}/billing/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/billing/",
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([
'address' => '',
'city' => '',
'country' => '',
'email' => '',
'first_name' => '',
'last_name' => '',
'other' => '',
'reg_number' => '',
'vat_number' => '',
'zip' => ''
]),
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('PUT', '{{baseUrl}}/billing/', [
'body' => '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/billing/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => '',
'city' => '',
'country' => '',
'email' => '',
'first_name' => '',
'last_name' => '',
'other' => '',
'reg_number' => '',
'vat_number' => '',
'zip' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => '',
'city' => '',
'country' => '',
'email' => '',
'first_name' => '',
'last_name' => '',
'other' => '',
'reg_number' => '',
'vat_number' => '',
'zip' => ''
]));
$request->setRequestUrl('{{baseUrl}}/billing/');
$request->setRequestMethod('PUT');
$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}}/billing/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/billing/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/billing/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/billing/"
payload = {
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/billing/"
payload <- "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/billing/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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/billing/') do |req|
req.body = "{\n \"address\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"email\": \"\",\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"other\": \"\",\n \"reg_number\": \"\",\n \"vat_number\": \"\",\n \"zip\": \"\"\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}}/billing/";
let payload = json!({
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/billing/ \
--header 'content-type: application/json' \
--data '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}'
echo '{
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
}' | \
http PUT {{baseUrl}}/billing/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "address": "",\n "city": "",\n "country": "",\n "email": "",\n "first_name": "",\n "last_name": "",\n "other": "",\n "reg_number": "",\n "vat_number": "",\n "zip": ""\n}' \
--output-document \
- {{baseUrl}}/billing/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": "",
"city": "",
"country": "",
"email": "",
"first_name": "",
"last_name": "",
"other": "",
"reg_number": "",
"vat_number": "",
"zip": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/billing/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"city": "Munich",
"country": "DE"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create account API key
{{baseUrl}}/keys/
BODY json
{
"id": "",
"key": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/keys/");
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 \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/keys/" {:content-type :json
:form-params {:id ""
:key ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/keys/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"key\": \"\",\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}}/keys/"),
Content = new StringContent("{\n \"id\": \"\",\n \"key\": \"\",\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}}/keys/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/keys/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\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/keys/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"id": "",
"key": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/keys/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/keys/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"key\": \"\",\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 \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/keys/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/keys/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
key: '',
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}}/keys/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/keys/',
headers: {'content-type': 'application/json'},
data: {id: '', key: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/keys/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","key":"","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}}/keys/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "key": "",\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 \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/keys/")
.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/keys/',
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({id: '', key: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/keys/',
headers: {'content-type': 'application/json'},
body: {id: '', key: '', 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}}/keys/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
key: '',
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}}/keys/',
headers: {'content-type': 'application/json'},
data: {id: '', key: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/keys/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","key":"","name":""}'
};
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 = @{ @"id": @"",
@"key": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/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}}/keys/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/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([
'id' => '',
'key' => '',
'name' => ''
]),
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}}/keys/', [
'body' => '{
"id": "",
"key": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/keys/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'key' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'key' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/keys/');
$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}}/keys/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"key": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/keys/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"key": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/keys/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/keys/"
payload = {
"id": "",
"key": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/keys/"
payload <- "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\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}}/keys/")
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 \"id\": \"\",\n \"key\": \"\",\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/keys/') do |req|
req.body = "{\n \"id\": \"\",\n \"key\": \"\",\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}}/keys/";
let payload = json!({
"id": "",
"key": "",
"name": ""
});
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}}/keys/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"key": "",
"name": ""
}'
echo '{
"id": "",
"key": "",
"name": ""
}' | \
http POST {{baseUrl}}/keys/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "key": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/keys/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"key": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"key": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJKR3ZRSTkzSTJhc0oiLCJ0ZW5hbnQiOiJwcm9iZWx5IiwidXNlcm5hbWUiOiJxd2VAZGVmbnVsbC5ldSJ9.7KtUn-Oy8aevOCv2lAnDroAJojLXmm7m2A4CX5cjwAk",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create target API key
{{baseUrl}}/targets/:target_id/keys/
QUERY PARAMS
target_id
BODY json
{
"id": "",
"key": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/keys/");
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 \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/keys/" {:content-type :json
:form-params {:id ""
:key ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/keys/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"key\": \"\",\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}}/targets/:target_id/keys/"),
Content = new StringContent("{\n \"id\": \"\",\n \"key\": \"\",\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}}/targets/:target_id/keys/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/keys/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\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/targets/:target_id/keys/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"id": "",
"key": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/keys/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/keys/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"key\": \"\",\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 \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/keys/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/keys/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
key: '',
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}}/targets/:target_id/keys/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/keys/',
headers: {'content-type': 'application/json'},
data: {id: '', key: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/keys/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","key":"","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}}/targets/:target_id/keys/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "key": "",\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 \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/keys/")
.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/targets/:target_id/keys/',
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({id: '', key: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/keys/',
headers: {'content-type': 'application/json'},
body: {id: '', key: '', 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}}/targets/:target_id/keys/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
key: '',
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}}/targets/:target_id/keys/',
headers: {'content-type': 'application/json'},
data: {id: '', key: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/keys/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","key":"","name":""}'
};
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 = @{ @"id": @"",
@"key": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/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}}/targets/:target_id/keys/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/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([
'id' => '',
'key' => '',
'name' => ''
]),
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}}/targets/:target_id/keys/', [
'body' => '{
"id": "",
"key": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/keys/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'key' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'key' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/keys/');
$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}}/targets/:target_id/keys/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"key": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/keys/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"key": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/keys/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/keys/"
payload = {
"id": "",
"key": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/keys/"
payload <- "{\n \"id\": \"\",\n \"key\": \"\",\n \"name\": \"\"\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}}/targets/:target_id/keys/")
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 \"id\": \"\",\n \"key\": \"\",\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/targets/:target_id/keys/') do |req|
req.body = "{\n \"id\": \"\",\n \"key\": \"\",\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}}/targets/:target_id/keys/";
let payload = json!({
"id": "",
"key": "",
"name": ""
});
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}}/targets/:target_id/keys/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"key": "",
"name": ""
}'
echo '{
"id": "",
"key": "",
"name": ""
}' | \
http POST {{baseUrl}}/targets/:target_id/keys/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "key": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/keys/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"key": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"key": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJKR3ZRSTkzSTJhc0oiLCJ0ZW5hbnQiOiJwcm9iZWx5IiwidXNlcm5hbWUiOiJxd2VAZGVmbnVsbC5ldSJ9.7KtUn-Oy8aevOCv2lAnDroAJojLXmm7m2A4CX5cjwAk",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete account API key
{{baseUrl}}/keys/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/keys/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/keys/:id/")
require "http/client"
url = "{{baseUrl}}/keys/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/keys/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/keys/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/keys/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/keys/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/keys/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/keys/:id/"))
.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}}/keys/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/keys/:id/")
.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}}/keys/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/keys/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/keys/:id/';
const options = {method: 'DELETE'};
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}}/keys/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/keys/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/keys/:id/',
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: 'DELETE', url: '{{baseUrl}}/keys/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/keys/:id/');
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}}/keys/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/keys/:id/';
const options = {method: 'DELETE'};
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}}/keys/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/keys/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/keys/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/keys/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/keys/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/keys/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/keys/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/keys/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/keys/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/keys/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/keys/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/keys/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/keys/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/keys/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/keys/:id/
http DELETE {{baseUrl}}/keys/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/keys/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/keys/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete target API key
{{baseUrl}}/targets/:target_id/keys/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/keys/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/targets/:target_id/keys/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/keys/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/keys/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/keys/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/keys/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/targets/:target_id/keys/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/targets/:target_id/keys/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/keys/:id/"))
.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}}/targets/:target_id/keys/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/targets/:target_id/keys/:id/")
.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}}/targets/:target_id/keys/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/keys/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/keys/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/keys/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/keys/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/keys/:id/',
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: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/keys/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/targets/:target_id/keys/:id/');
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}}/targets/:target_id/keys/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/keys/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/keys/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/targets/:target_id/keys/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/keys/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/targets/:target_id/keys/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/keys/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/keys/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/keys/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/keys/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/targets/:target_id/keys/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/keys/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/keys/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/keys/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/targets/:target_id/keys/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/keys/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/targets/:target_id/keys/:id/
http DELETE {{baseUrl}}/targets/:target_id/keys/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/targets/:target_id/keys/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/keys/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
List API keys allowed to operate on account
{{baseUrl}}/keys/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/keys/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/keys/")
require "http/client"
url = "{{baseUrl}}/keys/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/keys/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/keys/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/keys/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/keys/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/keys/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/keys/"))
.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}}/keys/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/keys/")
.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}}/keys/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/keys/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/keys/';
const options = {method: 'GET'};
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}}/keys/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/keys/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/keys/',
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: 'GET', url: '{{baseUrl}}/keys/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/keys/');
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}}/keys/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/keys/';
const options = {method: 'GET'};
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}}/keys/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/keys/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/keys/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/keys/');
echo $response->getBody();
setUrl('{{baseUrl}}/keys/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/keys/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/keys/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/keys/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/keys/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/keys/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/keys/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/keys/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/keys/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/keys/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/keys/
http GET {{baseUrl}}/keys/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/keys/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/keys/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List target specific API keys
{{baseUrl}}/targets/:target_id/keys/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/keys/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/keys/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/keys/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/keys/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/keys/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/keys/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/keys/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/keys/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/keys/"))
.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}}/targets/:target_id/keys/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/keys/")
.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}}/targets/:target_id/keys/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/keys/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/keys/';
const options = {method: 'GET'};
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}}/targets/:target_id/keys/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/keys/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/keys/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/keys/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/keys/');
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}}/targets/:target_id/keys/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/keys/';
const options = {method: 'GET'};
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}}/targets/:target_id/keys/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/keys/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/keys/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/keys/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/keys/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/keys/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/keys/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/keys/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/keys/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/keys/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/keys/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/keys/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/keys/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/keys/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/keys/
http GET {{baseUrl}}/targets/:target_id/keys/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/keys/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/keys/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve account API key
{{baseUrl}}/keys/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/keys/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/keys/:id/")
require "http/client"
url = "{{baseUrl}}/keys/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/keys/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/keys/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/keys/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/keys/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/keys/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/keys/:id/"))
.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}}/keys/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/keys/:id/")
.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}}/keys/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/keys/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/keys/:id/';
const options = {method: 'GET'};
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}}/keys/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/keys/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/keys/:id/',
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: 'GET', url: '{{baseUrl}}/keys/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/keys/:id/');
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}}/keys/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/keys/:id/';
const options = {method: 'GET'};
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}}/keys/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/keys/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/keys/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/keys/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/keys/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/keys/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/keys/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/keys/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/keys/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/keys/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/keys/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/keys/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/keys/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/keys/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/keys/:id/
http GET {{baseUrl}}/keys/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/keys/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/keys/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"key": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJKR3ZRSTkzSTJhc0oiLCJ0ZW5hbnQiOiJwcm9iZWx5IiwidXNlcm5hbWUiOiJxd2VAZGVmbnVsbC5ldSJ9.7KtUn-Oy8aevOCv2lAnDroAJojLXmm7m2A4CX5cjwAk",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve target API key
{{baseUrl}}/targets/:target_id/keys/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/keys/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/keys/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/keys/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/keys/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/keys/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/keys/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/keys/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/keys/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/keys/:id/"))
.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}}/targets/:target_id/keys/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/keys/:id/")
.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}}/targets/:target_id/keys/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/keys/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/keys/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/keys/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/keys/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/keys/:id/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/keys/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/keys/:id/');
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}}/targets/:target_id/keys/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/keys/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/keys/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/keys/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/keys/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/keys/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/keys/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/keys/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/keys/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/keys/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/keys/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/keys/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/keys/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/keys/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/keys/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/keys/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/keys/:id/
http GET {{baseUrl}}/targets/:target_id/keys/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/keys/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/keys/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"key": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJKR3ZRSTkzSTJhc0oiLCJ0ZW5hbnQiOiJwcm9iZWx5IiwidXNlcm5hbWUiOiJxd2VAZGVmbnVsbC5ldSJ9.7KtUn-Oy8aevOCv2lAnDroAJojLXmm7m2A4CX5cjwAk",
"name": "Object name"
}
POST
Activate targets
{{baseUrl}}/targets/activate/
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/activate/");
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 {}\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/activate/" {:content-type :json
:form-params [{}]})
require "http/client"
url = "{{baseUrl}}/targets/activate/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\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}}/targets/activate/"),
Content = new StringContent("[\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}}/targets/activate/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {}\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/activate/"
payload := strings.NewReader("[\n {}\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/targets/activate/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 8
[
{}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/activate/")
.setHeader("content-type", "application/json")
.setBody("[\n {}\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/activate/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\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 {}\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/activate/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/activate/")
.header("content-type", "application/json")
.body("[\n {}\n]")
.asString();
const data = JSON.stringify([
{}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/activate/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/activate/',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/activate/';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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}}/targets/activate/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\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 {}\n]")
val request = Request.Builder()
.url("{{baseUrl}}/targets/activate/")
.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/targets/activate/',
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([{}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/activate/',
headers: {'content-type': 'application/json'},
body: [{}],
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}}/targets/activate/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{}
]);
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}}/targets/activate/',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/activate/';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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 = @[ @{ } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/activate/"]
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}}/targets/activate/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {}\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/activate/",
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([
[
]
]),
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}}/targets/activate/', [
'body' => '[
{}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/activate/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/activate/');
$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}}/targets/activate/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/activate/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {}\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/activate/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/activate/"
payload = [{}]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/activate/"
payload <- "[\n {}\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}}/targets/activate/")
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 {}\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/targets/activate/') do |req|
req.body = "[\n {}\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/activate/";
let payload = (json!({}));
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}}/targets/activate/ \
--header 'content-type: application/json' \
--data '[
{}
]'
echo '[
{}
]' | \
http POST {{baseUrl}}/targets/activate/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {}\n]' \
--output-document \
- {{baseUrl}}/targets/activate/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [[]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/activate/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
"jMXUw-BE_2vd"
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Archive targets
{{baseUrl}}/targets/archive/
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/archive/");
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 {}\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/archive/" {:content-type :json
:form-params [{}]})
require "http/client"
url = "{{baseUrl}}/targets/archive/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\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}}/targets/archive/"),
Content = new StringContent("[\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}}/targets/archive/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {}\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/archive/"
payload := strings.NewReader("[\n {}\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/targets/archive/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 8
[
{}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/archive/")
.setHeader("content-type", "application/json")
.setBody("[\n {}\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/archive/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\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 {}\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/archive/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/archive/")
.header("content-type", "application/json")
.body("[\n {}\n]")
.asString();
const data = JSON.stringify([
{}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/archive/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/archive/',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/archive/';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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}}/targets/archive/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\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 {}\n]")
val request = Request.Builder()
.url("{{baseUrl}}/targets/archive/")
.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/targets/archive/',
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([{}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/archive/',
headers: {'content-type': 'application/json'},
body: [{}],
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}}/targets/archive/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{}
]);
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}}/targets/archive/',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/archive/';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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 = @[ @{ } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/archive/"]
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}}/targets/archive/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {}\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/archive/",
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([
[
]
]),
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}}/targets/archive/', [
'body' => '[
{}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/archive/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/archive/');
$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}}/targets/archive/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/archive/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {}\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/archive/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/archive/"
payload = [{}]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/archive/"
payload <- "[\n {}\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}}/targets/archive/")
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 {}\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/targets/archive/') do |req|
req.body = "[\n {}\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/archive/";
let payload = (json!({}));
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}}/targets/archive/ \
--header 'content-type: application/json' \
--data '[
{}
]'
echo '[
{}
]' | \
http POST {{baseUrl}}/targets/archive/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {}\n]' \
--output-document \
- {{baseUrl}}/targets/archive/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [[]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/archive/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
"jMXUw-BE_2vd"
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
List archived targets
{{baseUrl}}/targets/archived/
BODY json
[
{}
]
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/archived/");
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 {}\n]");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/archived/" {:content-type :json
:form-params [{}]})
require "http/client"
url = "{{baseUrl}}/targets/archived/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "[\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}}/targets/archived/"),
Content = new StringContent("[\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}}/targets/archived/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n {}\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/archived/"
payload := strings.NewReader("[\n {}\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/targets/archived/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 8
[
{}
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/archived/")
.setHeader("content-type", "application/json")
.setBody("[\n {}\n]")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/archived/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\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 {}\n]");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/archived/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/archived/")
.header("content-type", "application/json")
.body("[\n {}\n]")
.asString();
const data = JSON.stringify([
{}
]);
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/archived/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/archived/',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/archived/';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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}}/targets/archived/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '[\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 {}\n]")
val request = Request.Builder()
.url("{{baseUrl}}/targets/archived/")
.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/targets/archived/',
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([{}]));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/archived/',
headers: {'content-type': 'application/json'},
body: [{}],
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}}/targets/archived/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send([
{}
]);
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}}/targets/archived/',
headers: {'content-type': 'application/json'},
data: [{}]
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/archived/';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '[{}]'};
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 = @[ @{ } ];
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/archived/"]
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}}/targets/archived/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "[\n {}\n]" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/archived/",
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([
[
]
]),
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}}/targets/archived/', [
'body' => '[
{}
]',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/archived/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
[
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
[
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/archived/');
$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}}/targets/archived/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/archived/' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
{}
]'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "[\n {}\n]"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/archived/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/archived/"
payload = [{}]
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/archived/"
payload <- "[\n {}\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}}/targets/archived/")
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 {}\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/targets/archived/') do |req|
req.body = "[\n {}\n]"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/archived/";
let payload = (json!({}));
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}}/targets/archived/ \
--header 'content-type: application/json' \
--data '[
{}
]'
echo '[
{}
]' | \
http POST {{baseUrl}}/targets/archived/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '[\n {}\n]' \
--output-document \
- {{baseUrl}}/targets/archived/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [[]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/archived/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"length": 10,
"page": 1,
"page_total": 1,
"pagination_count": 6
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create new asset
{{baseUrl}}/targets/:target_id/assets/
QUERY PARAMS
target_id
BODY json
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/");
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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/assets/" {:content-type :json
:form-params {:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:headers [{:name ""
:value ""}]
:host ""
:id ""
:include false
:name ""
:stack []
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/"),
Content = new StringContent("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/"
payload := strings.NewReader("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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/targets/:target_id/assets/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 451
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/assets/")
.setHeader("content-type", "application/json")
.setBody("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/assets/")
.header("content-type", "application/json")
.body("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
.asString();
const data = JSON.stringify({
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/assets/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/assets/',
headers: {'content-type': 'application/json'},
data: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}'
};
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}}/targets/:target_id/assets/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/")
.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/targets/:target_id/assets/',
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({
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/assets/',
headers: {'content-type': 'application/json'},
body: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
},
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}}/targets/:target_id/assets/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
});
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}}/targets/:target_id/assets/',
headers: {'content-type': 'application/json'},
data: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}'
};
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 = @{ @"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"cookies": @[ @{ @"name": @"", @"value": @"" } ],
@"desc": @"",
@"headers": @[ @{ @"name": @"", @"value": @"" } ],
@"host": @"",
@"id": @"",
@"include": @NO,
@"name": @"",
@"stack": @[ ],
@"verification_date": @"",
@"verification_last_error": @"",
@"verification_method": @"",
@"verification_token": @"",
@"verified": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/assets/"]
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}}/targets/:target_id/assets/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/",
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([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]),
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}}/targets/:target_id/assets/', [
'body' => '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/assets/');
$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}}/targets/:target_id/assets/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/assets/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/"
payload = {
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": False,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/"
payload <- "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/")
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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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/targets/:target_id/assets/') do |req|
req.body = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/assets/";
let payload = json!({
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"include": false,
"name": "",
"stack": (),
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
});
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}}/targets/:target_id/assets/ \
--header 'content-type: application/json' \
--data '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
echo '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}' | \
http POST {{baseUrl}}/targets/:target_id/assets/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete asset
{{baseUrl}}/targets/:target_id/assets/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/targets/:target_id/assets/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/assets/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/assets/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/targets/:target_id/assets/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/targets/:target_id/assets/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/:id/"))
.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}}/targets/:target_id/assets/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/targets/:target_id/assets/:id/")
.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}}/targets/:target_id/assets/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/assets/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/assets/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/assets/:id/',
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: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/assets/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/targets/:target_id/assets/:id/');
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}}/targets/:target_id/assets/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/assets/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/targets/:target_id/assets/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/targets/:target_id/assets/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/assets/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/targets/:target_id/assets/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/assets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/targets/:target_id/assets/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/assets/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/targets/:target_id/assets/:id/
http DELETE {{baseUrl}}/targets/:target_id/assets/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List target's assets
{{baseUrl}}/targets/:target_id/assets/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/assets/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/assets/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/assets/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/assets/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/assets/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/"))
.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}}/targets/:target_id/assets/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/assets/")
.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}}/targets/:target_id/assets/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/assets/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/';
const options = {method: 'GET'};
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}}/targets/:target_id/assets/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/assets/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/assets/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/assets/');
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}}/targets/:target_id/assets/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/';
const options = {method: 'GET'};
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}}/targets/:target_id/assets/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/assets/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/assets/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/assets/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/assets/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/assets/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/assets/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/assets/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/assets/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/assets/
http GET {{baseUrl}}/targets/:target_id/assets/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update assets
{{baseUrl}}/targets/:target_id/assets/:id/
QUERY PARAMS
target_id
id
BODY json
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/:id/");
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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/assets/:id/" {:content-type :json
:form-params {:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:headers [{:name ""
:value ""}]
:host ""
:id ""
:include false
:name ""
:stack []
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/assets/:id/"),
Content = new StringContent("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/:id/"
payload := strings.NewReader("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/assets/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 451
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/assets/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/assets/:id/")
.header("content-type", "application/json")
.body("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
.asString();
const data = JSON.stringify({
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/assets/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/assets/:id/',
headers: {'content-type': 'application/json'},
data: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}'
};
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}}/targets/:target_id/assets/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/assets/:id/',
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({
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/assets/:id/',
headers: {'content-type': 'application/json'},
body: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/assets/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
});
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}}/targets/:target_id/assets/:id/',
headers: {'content-type': 'application/json'},
data: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}'
};
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 = @{ @"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"cookies": @[ @{ @"name": @"", @"value": @"" } ],
@"desc": @"",
@"headers": @[ @{ @"name": @"", @"value": @"" } ],
@"host": @"",
@"id": @"",
@"include": @NO,
@"name": @"",
@"stack": @[ ],
@"verification_date": @"",
@"verification_last_error": @"",
@"verification_method": @"",
@"verification_token": @"",
@"verified": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/assets/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/assets/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/assets/:id/', [
'body' => '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/assets/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/assets/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
payload = {
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": False,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/:id/"
payload <- "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/assets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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.patch('/baseUrl/targets/:target_id/assets/:id/') do |req|
req.body = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/:id/";
let payload = json!({
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"include": false,
"name": "",
"stack": (),
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/assets/:id/ \
--header 'content-type: application/json' \
--data '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
echo '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}' | \
http PATCH {{baseUrl}}/targets/:target_id/assets/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve asset
{{baseUrl}}/targets/:target_id/assets/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/assets/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/assets/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/assets/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/assets/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/assets/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/:id/"))
.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}}/targets/:target_id/assets/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/assets/:id/")
.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}}/targets/:target_id/assets/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/assets/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/assets/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/assets/:id/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/assets/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/assets/:id/');
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}}/targets/:target_id/assets/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/assets/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/assets/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/assets/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/assets/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/assets/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/assets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/assets/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/assets/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/assets/:id/
http GET {{baseUrl}}/targets/:target_id/assets/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update asset
{{baseUrl}}/targets/:target_id/assets/:id/
QUERY PARAMS
target_id
id
BODY json
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/:id/");
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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/assets/:id/" {:content-type :json
:form-params {:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:headers [{:name ""
:value ""}]
:host ""
:id ""
:include false
:name ""
:stack []
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/:id/"),
Content = new StringContent("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/:id/"
payload := strings.NewReader("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/assets/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 451
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/assets/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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 \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/assets/:id/")
.header("content-type", "application/json")
.body("{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
.asString();
const data = JSON.stringify({
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/assets/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/assets/:id/',
headers: {'content-type': 'application/json'},
data: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}'
};
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}}/targets/:target_id/assets/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/")
.put(body)
.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/targets/:target_id/assets/:id/',
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({
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/assets/:id/',
headers: {'content-type': 'application/json'},
body: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
},
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}}/targets/:target_id/assets/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
});
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}}/targets/:target_id/assets/:id/',
headers: {'content-type': 'application/json'},
data: {
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}'
};
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 = @{ @"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"cookies": @[ @{ @"name": @"", @"value": @"" } ],
@"desc": @"",
@"headers": @[ @{ @"name": @"", @"value": @"" } ],
@"host": @"",
@"id": @"",
@"include": @NO,
@"name": @"",
@"stack": @[ ],
@"verification_date": @"",
@"verification_last_error": @"",
@"verification_method": @"",
@"verification_token": @"",
@"verified": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/assets/:id/"]
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}}/targets/:target_id/assets/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/:id/",
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([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]),
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('PUT', '{{baseUrl}}/targets/:target_id/assets/:id/', [
'body' => '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/assets/:id/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/assets/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/assets/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/:id/"
payload = {
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": False,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/:id/"
payload <- "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/assets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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/targets/:target_id/assets/:id/') do |req|
req.body = "{\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\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}}/targets/:target_id/assets/:id/";
let payload = json!({
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"include": false,
"name": "",
"stack": (),
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/assets/:id/ \
--header 'content-type: application/json' \
--data '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}'
echo '{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}' | \
http PUT {{baseUrl}}/targets/:target_id/assets/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Verify asset ownership
{{baseUrl}}/targets/:target_id/assets/:id/verify/
QUERY PARAMS
target_id
id
BODY json
{
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/assets/:id/verify/");
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 \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/assets/:id/verify/" {:content-type :json
:form-params {:type ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/assets/:id/verify/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"type\": \"\"\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}}/targets/:target_id/assets/:id/verify/"),
Content = new StringContent("{\n \"type\": \"\"\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}}/targets/:target_id/assets/:id/verify/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/assets/:id/verify/"
payload := strings.NewReader("{\n \"type\": \"\"\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/targets/:target_id/assets/:id/verify/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/assets/:id/verify/")
.setHeader("content-type", "application/json")
.setBody("{\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/assets/:id/verify/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"type\": \"\"\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 \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/verify/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/assets/:id/verify/")
.header("content-type", "application/json")
.body("{\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/assets/:id/verify/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/assets/:id/verify/',
headers: {'content-type': 'application/json'},
data: {type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/assets/:id/verify/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"type":""}'
};
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}}/targets/:target_id/assets/:id/verify/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/assets/:id/verify/")
.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/targets/:target_id/assets/:id/verify/',
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({type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/assets/:id/verify/',
headers: {'content-type': 'application/json'},
body: {type: ''},
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}}/targets/:target_id/assets/:id/verify/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
type: ''
});
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}}/targets/:target_id/assets/:id/verify/',
headers: {'content-type': 'application/json'},
data: {type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/assets/:id/verify/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"type":""}'
};
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 = @{ @"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/assets/:id/verify/"]
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}}/targets/:target_id/assets/:id/verify/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/assets/:id/verify/",
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([
'type' => ''
]),
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}}/targets/:target_id/assets/:id/verify/', [
'body' => '{
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/assets/:id/verify/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/assets/:id/verify/');
$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}}/targets/:target_id/assets/:id/verify/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/assets/:id/verify/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/assets/:id/verify/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/assets/:id/verify/"
payload = { "type": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/assets/:id/verify/"
payload <- "{\n \"type\": \"\"\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}}/targets/:target_id/assets/:id/verify/")
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 \"type\": \"\"\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/targets/:target_id/assets/:id/verify/') do |req|
req.body = "{\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/assets/:id/verify/";
let payload = json!({"type": ""});
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}}/targets/:target_id/assets/:id/verify/ \
--header 'content-type: application/json' \
--data '{
"type": ""
}'
echo '{
"type": ""
}' | \
http POST {{baseUrl}}/targets/:target_id/assets/:id/verify/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/assets/:id/verify/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["type": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/assets/:id/verify/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create new account webhook
{{baseUrl}}/webhooks/
BODY json
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhooks/");
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/webhooks/" {:content-type :json
:form-params {:api_version ""
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:check_cert false
:created ""
:created_by {}
:id ""
:name ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/webhooks/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/"),
Content = new StringContent("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhooks/"
payload := strings.NewReader("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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/webhooks/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 208
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhooks/")
.setHeader("content-type", "application/json")
.setBody("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhooks/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/webhooks/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhooks/")
.header("content-type", "application/json")
.body("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/webhooks/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/webhooks/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhooks/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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}}/webhooks/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/webhooks/")
.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/webhooks/',
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({
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/webhooks/',
headers: {'content-type': 'application/json'},
body: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
},
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}}/webhooks/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
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}}/webhooks/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhooks/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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 = @{ @"api_version": @"",
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"check_cert": @NO,
@"created": @"",
@"created_by": @{ },
@"id": @"",
@"name": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhooks/"]
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}}/webhooks/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhooks/",
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([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]),
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}}/webhooks/', [
'body' => '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhooks/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/webhooks/');
$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}}/webhooks/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhooks/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/webhooks/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhooks/"
payload = {
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": False,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhooks/"
payload <- "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/")
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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/webhooks/') do |req|
req.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhooks/";
let payload = json!({
"api_version": "",
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"check_cert": false,
"created": "",
"created_by": json!({}),
"id": "",
"name": "",
"url": ""
});
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}}/webhooks/ \
--header 'content-type: application/json' \
--data '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
echo '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}' | \
http POST {{baseUrl}}/webhooks/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/webhooks/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"api_version": "",
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"check_cert": false,
"created": "",
"created_by": [],
"id": "",
"name": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhooks/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create new target webhook
{{baseUrl}}/targets/:target_id/webhooks/
QUERY PARAMS
target_id
BODY json
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/webhooks/");
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/webhooks/" {:content-type :json
:form-params {:api_version ""
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:check_cert false
:created ""
:created_by {}
:id ""
:name ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/webhooks/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/"),
Content = new StringContent("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/webhooks/"
payload := strings.NewReader("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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/targets/:target_id/webhooks/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 208
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/webhooks/")
.setHeader("content-type", "application/json")
.setBody("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/webhooks/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/webhooks/")
.header("content-type", "application/json")
.body("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/webhooks/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/webhooks/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/webhooks/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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}}/targets/:target_id/webhooks/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/")
.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/targets/:target_id/webhooks/',
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({
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/webhooks/',
headers: {'content-type': 'application/json'},
body: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
},
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}}/targets/:target_id/webhooks/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
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}}/targets/:target_id/webhooks/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/webhooks/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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 = @{ @"api_version": @"",
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"check_cert": @NO,
@"created": @"",
@"created_by": @{ },
@"id": @"",
@"name": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/webhooks/"]
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}}/targets/:target_id/webhooks/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/webhooks/",
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([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]),
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}}/targets/:target_id/webhooks/', [
'body' => '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/webhooks/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/webhooks/');
$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}}/targets/:target_id/webhooks/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/webhooks/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/webhooks/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/webhooks/"
payload = {
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": False,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/webhooks/"
payload <- "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/")
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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/targets/:target_id/webhooks/') do |req|
req.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/webhooks/";
let payload = json!({
"api_version": "",
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"check_cert": false,
"created": "",
"created_by": json!({}),
"id": "",
"name": "",
"url": ""
});
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}}/targets/:target_id/webhooks/ \
--header 'content-type: application/json' \
--data '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
echo '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}' | \
http POST {{baseUrl}}/targets/:target_id/webhooks/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/webhooks/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"api_version": "",
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"check_cert": false,
"created": "",
"created_by": [],
"id": "",
"name": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/webhooks/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete account webhook
{{baseUrl}}/webhooks/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhooks/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/webhooks/:id/")
require "http/client"
url = "{{baseUrl}}/webhooks/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/webhooks/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhooks/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhooks/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/webhooks/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/webhooks/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhooks/:id/"))
.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}}/webhooks/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/webhooks/:id/")
.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}}/webhooks/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/webhooks/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhooks/:id/';
const options = {method: 'DELETE'};
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}}/webhooks/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhooks/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhooks/:id/',
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: 'DELETE', url: '{{baseUrl}}/webhooks/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/webhooks/:id/');
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}}/webhooks/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhooks/:id/';
const options = {method: 'DELETE'};
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}}/webhooks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/webhooks/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhooks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/webhooks/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/webhooks/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhooks/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhooks/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhooks/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/webhooks/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhooks/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhooks/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/webhooks/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhooks/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/webhooks/:id/
http DELETE {{baseUrl}}/webhooks/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/webhooks/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhooks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete target webhook
{{baseUrl}}/targets/:target_id/webhooks/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/webhooks/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/targets/:target_id/webhooks/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/webhooks/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/webhooks/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/webhooks/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/targets/:target_id/webhooks/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/targets/:target_id/webhooks/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/webhooks/:id/"))
.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}}/targets/:target_id/webhooks/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.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}}/targets/:target_id/webhooks/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/webhooks/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/webhooks/:id/',
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: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
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}}/targets/:target_id/webhooks/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/webhooks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/targets/:target_id/webhooks/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/webhooks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/webhooks/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/webhooks/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/targets/:target_id/webhooks/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/webhooks/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/targets/:target_id/webhooks/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/webhooks/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/targets/:target_id/webhooks/:id/
http DELETE {{baseUrl}}/targets/:target_id/webhooks/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/targets/:target_id/webhooks/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/webhooks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List account events
{{baseUrl}}/events/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/events/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/events/")
require "http/client"
url = "{{baseUrl}}/events/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/events/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/events/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/events/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/events/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/events/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/events/"))
.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}}/events/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/events/")
.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}}/events/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/events/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/events/';
const options = {method: 'GET'};
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}}/events/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/events/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/events/',
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: 'GET', url: '{{baseUrl}}/events/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/events/');
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}}/events/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/events/';
const options = {method: 'GET'};
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}}/events/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/events/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/events/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/events/');
echo $response->getBody();
setUrl('{{baseUrl}}/events/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/events/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/events/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/events/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/events/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/events/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/events/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/events/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/events/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/events/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/events/
http GET {{baseUrl}}/events/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/events/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/events/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List account webhooks
{{baseUrl}}/webhooks/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhooks/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/webhooks/")
require "http/client"
url = "{{baseUrl}}/webhooks/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/webhooks/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhooks/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhooks/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/webhooks/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhooks/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhooks/"))
.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}}/webhooks/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhooks/")
.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}}/webhooks/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/webhooks/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhooks/';
const options = {method: 'GET'};
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}}/webhooks/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhooks/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhooks/',
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: 'GET', url: '{{baseUrl}}/webhooks/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/webhooks/');
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}}/webhooks/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhooks/';
const options = {method: 'GET'};
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}}/webhooks/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/webhooks/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhooks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/webhooks/');
echo $response->getBody();
setUrl('{{baseUrl}}/webhooks/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhooks/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhooks/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhooks/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/webhooks/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhooks/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhooks/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhooks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/webhooks/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhooks/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/webhooks/
http GET {{baseUrl}}/webhooks/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/webhooks/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhooks/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List target events
{{baseUrl}}/targets/:target_id/events/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/events/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/events/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/events/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/events/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/events/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/events/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/events/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/events/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/events/"))
.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}}/targets/:target_id/events/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/events/")
.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}}/targets/:target_id/events/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/events/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/events/';
const options = {method: 'GET'};
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}}/targets/:target_id/events/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/events/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/events/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/events/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/events/');
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}}/targets/:target_id/events/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/events/';
const options = {method: 'GET'};
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}}/targets/:target_id/events/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/events/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/events/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/events/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/events/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/events/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/events/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/events/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/events/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/events/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/events/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/events/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/events/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/events/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/events/
http GET {{baseUrl}}/targets/:target_id/events/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/events/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/events/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List target webhooks
{{baseUrl}}/targets/:target_id/webhooks/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/webhooks/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/webhooks/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/webhooks/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/webhooks/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/webhooks/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/webhooks/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/webhooks/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/webhooks/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/webhooks/"))
.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}}/targets/:target_id/webhooks/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/webhooks/")
.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}}/targets/:target_id/webhooks/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/webhooks/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/webhooks/';
const options = {method: 'GET'};
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}}/targets/:target_id/webhooks/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/webhooks/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/webhooks/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/webhooks/');
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}}/targets/:target_id/webhooks/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/webhooks/';
const options = {method: 'GET'};
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}}/targets/:target_id/webhooks/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/webhooks/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/webhooks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/webhooks/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/webhooks/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/webhooks/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/webhooks/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/webhooks/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/webhooks/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/webhooks/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/webhooks/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/webhooks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/webhooks/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/webhooks/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/webhooks/
http GET {{baseUrl}}/targets/:target_id/webhooks/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/webhooks/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/webhooks/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update account webhook
{{baseUrl}}/webhooks/:id/
QUERY PARAMS
id
BODY json
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhooks/:id/");
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/webhooks/:id/" {:content-type :json
:form-params {:api_version ""
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:check_cert false
:created ""
:created_by {}
:id ""
:name ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/webhooks/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/webhooks/:id/"),
Content = new StringContent("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhooks/:id/"
payload := strings.NewReader("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/webhooks/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 208
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/webhooks/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhooks/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/webhooks/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/webhooks/:id/")
.header("content-type", "application/json")
.body("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/webhooks/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhooks/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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}}/webhooks/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/webhooks/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhooks/:id/',
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({
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/webhooks/:id/',
headers: {'content-type': 'application/json'},
body: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/webhooks/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
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}}/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhooks/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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 = @{ @"api_version": @"",
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"check_cert": @NO,
@"created": @"",
@"created_by": @{ },
@"id": @"",
@"name": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhooks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/webhooks/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhooks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]),
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('PATCH', '{{baseUrl}}/webhooks/:id/', [
'body' => '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhooks/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/webhooks/:id/');
$request->setRequestMethod('PATCH');
$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}}/webhooks/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhooks/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/webhooks/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhooks/:id/"
payload = {
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": False,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhooks/:id/"
payload <- "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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.patch('/baseUrl/webhooks/:id/') do |req|
req.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/:id/";
let payload = json!({
"api_version": "",
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"check_cert": false,
"created": "",
"created_by": json!({}),
"id": "",
"name": "",
"url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/webhooks/:id/ \
--header 'content-type: application/json' \
--data '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
echo '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}' | \
http PATCH {{baseUrl}}/webhooks/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/webhooks/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"api_version": "",
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"check_cert": false,
"created": "",
"created_by": [],
"id": "",
"name": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhooks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update target webhook
{{baseUrl}}/targets/:target_id/webhooks/:id/
QUERY PARAMS
target_id
id
BODY json
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/webhooks/:id/");
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/webhooks/:id/" {:content-type :json
:form-params {:api_version ""
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:check_cert false
:created ""
:created_by {}
:id ""
:name ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/webhooks/:id/"),
Content = new StringContent("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/webhooks/:id/"
payload := strings.NewReader("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/webhooks/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 208
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/webhooks/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/webhooks/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.header("content-type", "application/json")
.body("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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}}/targets/:target_id/webhooks/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/webhooks/:id/',
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({
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/',
headers: {'content-type': 'application/json'},
body: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
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}}/targets/:target_id/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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 = @{ @"api_version": @"",
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"check_cert": @NO,
@"created": @"",
@"created_by": @{ },
@"id": @"",
@"name": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/webhooks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/webhooks/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/webhooks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/webhooks/:id/', [
'body' => '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/webhooks/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/webhooks/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/webhooks/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
payload = {
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": False,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/webhooks/:id/"
payload <- "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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.patch('/baseUrl/targets/:target_id/webhooks/:id/') do |req|
req.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/:id/";
let payload = json!({
"api_version": "",
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"check_cert": false,
"created": "",
"created_by": json!({}),
"id": "",
"name": "",
"url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/webhooks/:id/ \
--header 'content-type: application/json' \
--data '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
echo '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}' | \
http PATCH {{baseUrl}}/targets/:target_id/webhooks/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/webhooks/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"api_version": "",
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"check_cert": false,
"created": "",
"created_by": [],
"id": "",
"name": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/webhooks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve account event
{{baseUrl}}/events/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/events/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/events/:id/")
require "http/client"
url = "{{baseUrl}}/events/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/events/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/events/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/events/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/events/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/events/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/events/:id/"))
.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}}/events/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/events/:id/")
.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}}/events/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/events/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/events/:id/';
const options = {method: 'GET'};
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}}/events/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/events/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/events/:id/',
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: 'GET', url: '{{baseUrl}}/events/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/events/:id/');
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}}/events/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/events/:id/';
const options = {method: 'GET'};
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}}/events/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/events/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/events/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/events/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/events/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/events/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/events/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/events/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/events/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/events/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/events/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/events/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/events/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/events/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/events/:id/
http GET {{baseUrl}}/events/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/events/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/events/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"event_type": "scan_started",
"id": "jMXUw-BE_2vd",
"ocurred_at": "2018-01-31T16:32:17.238553Z"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve account webhook
{{baseUrl}}/webhooks/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhooks/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/webhooks/:id/")
require "http/client"
url = "{{baseUrl}}/webhooks/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/webhooks/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhooks/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhooks/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/webhooks/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhooks/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhooks/:id/"))
.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}}/webhooks/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhooks/:id/")
.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}}/webhooks/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/webhooks/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhooks/:id/';
const options = {method: 'GET'};
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}}/webhooks/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhooks/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhooks/:id/',
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: 'GET', url: '{{baseUrl}}/webhooks/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/webhooks/:id/');
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}}/webhooks/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhooks/:id/';
const options = {method: 'GET'};
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}}/webhooks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/webhooks/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhooks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/webhooks/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/webhooks/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhooks/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhooks/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhooks/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/webhooks/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhooks/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhooks/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/webhooks/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhooks/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/webhooks/:id/
http GET {{baseUrl}}/webhooks/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/webhooks/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhooks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve target event
{{baseUrl}}/targets/:target_id/events/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/events/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/events/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/events/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/events/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/events/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/events/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/events/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/events/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/events/:id/"))
.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}}/targets/:target_id/events/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/events/:id/")
.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}}/targets/:target_id/events/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/events/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/events/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/events/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/events/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/events/:id/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/events/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/events/:id/');
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}}/targets/:target_id/events/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/events/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/events/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/events/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/events/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/events/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/events/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/events/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/events/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/events/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/events/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/events/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/events/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/events/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/events/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/events/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/events/:id/
http GET {{baseUrl}}/targets/:target_id/events/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/events/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/events/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"event_type": "scan_started",
"id": "jMXUw-BE_2vd",
"ocurred_at": "2018-01-31T16:32:17.238553Z"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve target webhook
{{baseUrl}}/targets/:target_id/webhooks/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/webhooks/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/webhooks/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/webhooks/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/webhooks/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/webhooks/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/webhooks/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/webhooks/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/webhooks/:id/"))
.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}}/targets/:target_id/webhooks/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.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}}/targets/:target_id/webhooks/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/webhooks/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/webhooks/:id/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
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}}/targets/:target_id/webhooks/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/webhooks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/webhooks/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/webhooks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/webhooks/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/webhooks/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/webhooks/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/webhooks/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/webhooks/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/webhooks/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/webhooks/:id/
http GET {{baseUrl}}/targets/:target_id/webhooks/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/webhooks/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/webhooks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update account webhook
{{baseUrl}}/webhooks/:id/
QUERY PARAMS
id
BODY json
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhooks/:id/");
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/webhooks/:id/" {:content-type :json
:form-params {:api_version ""
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:check_cert false
:created ""
:created_by {}
:id ""
:name ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/webhooks/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/:id/"),
Content = new StringContent("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhooks/:id/"
payload := strings.NewReader("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/webhooks/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 208
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/webhooks/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhooks/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/webhooks/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/webhooks/:id/")
.header("content-type", "application/json")
.body("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/webhooks/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhooks/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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}}/webhooks/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/webhooks/:id/")
.put(body)
.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/webhooks/:id/',
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({
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/webhooks/:id/',
headers: {'content-type': 'application/json'},
body: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
},
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}}/webhooks/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
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}}/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhooks/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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 = @{ @"api_version": @"",
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"check_cert": @NO,
@"created": @"",
@"created_by": @{ },
@"id": @"",
@"name": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhooks/:id/"]
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}}/webhooks/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhooks/:id/",
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([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]),
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('PUT', '{{baseUrl}}/webhooks/:id/', [
'body' => '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhooks/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/webhooks/:id/');
$request->setRequestMethod('PUT');
$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}}/webhooks/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhooks/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/webhooks/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhooks/:id/"
payload = {
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": False,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhooks/:id/"
payload <- "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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/webhooks/:id/') do |req|
req.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/webhooks/:id/";
let payload = json!({
"api_version": "",
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"check_cert": false,
"created": "",
"created_by": json!({}),
"id": "",
"name": "",
"url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/webhooks/:id/ \
--header 'content-type: application/json' \
--data '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
echo '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}' | \
http PUT {{baseUrl}}/webhooks/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/webhooks/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"api_version": "",
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"check_cert": false,
"created": "",
"created_by": [],
"id": "",
"name": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhooks/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update target webhook
{{baseUrl}}/targets/:target_id/webhooks/:id/
QUERY PARAMS
target_id
id
BODY json
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/webhooks/:id/");
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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/webhooks/:id/" {:content-type :json
:form-params {:api_version ""
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:check_cert false
:created ""
:created_by {}
:id ""
:name ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/:id/"),
Content = new StringContent("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/webhooks/:id/"
payload := strings.NewReader("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/webhooks/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 208
{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/webhooks/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/webhooks/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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 \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.header("content-type", "application/json")
.body("{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/webhooks/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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}}/targets/:target_id/webhooks/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/webhooks/:id/")
.put(body)
.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/targets/:target_id/webhooks/:id/',
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({
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/webhooks/:id/',
headers: {'content-type': 'application/json'},
body: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
},
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}}/targets/:target_id/webhooks/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
api_version: '',
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
});
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}}/targets/:target_id/webhooks/:id/',
headers: {'content-type': 'application/json'},
data: {
api_version: '',
changed: '',
changed_by: {email: '', id: '', name: ''},
check_cert: false,
created: '',
created_by: {},
id: '',
name: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/webhooks/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"api_version":"","changed":"","changed_by":{"email":"","id":"","name":""},"check_cert":false,"created":"","created_by":{},"id":"","name":"","url":""}'
};
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 = @{ @"api_version": @"",
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"check_cert": @NO,
@"created": @"",
@"created_by": @{ },
@"id": @"",
@"name": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/webhooks/:id/"]
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}}/targets/:target_id/webhooks/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/webhooks/:id/",
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([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]),
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('PUT', '{{baseUrl}}/targets/:target_id/webhooks/:id/', [
'body' => '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'api_version' => '',
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'check_cert' => null,
'created' => '',
'created_by' => [
],
'id' => '',
'name' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/webhooks/:id/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/webhooks/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/webhooks/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/webhooks/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/webhooks/:id/"
payload = {
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": False,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/webhooks/:id/"
payload <- "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/webhooks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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/targets/:target_id/webhooks/:id/') do |req|
req.body = "{\n \"api_version\": \"\",\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"check_cert\": false,\n \"created\": \"\",\n \"created_by\": {},\n \"id\": \"\",\n \"name\": \"\",\n \"url\": \"\"\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}}/targets/:target_id/webhooks/:id/";
let payload = json!({
"api_version": "",
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"check_cert": false,
"created": "",
"created_by": json!({}),
"id": "",
"name": "",
"url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/webhooks/:id/ \
--header 'content-type: application/json' \
--data '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}'
echo '{
"api_version": "",
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"check_cert": false,
"created": "",
"created_by": {},
"id": "",
"name": "",
"url": ""
}' | \
http PUT {{baseUrl}}/targets/:target_id/webhooks/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "api_version": "",\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "check_cert": false,\n "created": "",\n "created_by": {},\n "id": "",\n "name": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/webhooks/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"api_version": "",
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"check_cert": false,
"created": "",
"created_by": [],
"id": "",
"name": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/webhooks/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Bulk retest findings
{{baseUrl}}/targets/:target_id/findings/bulk/retest/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/bulk/retest/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/findings/bulk/retest/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/bulk/retest/"
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}}/targets/:target_id/findings/bulk/retest/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/bulk/retest/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/bulk/retest/"
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/targets/:target_id/findings/bulk/retest/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/findings/bulk/retest/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/bulk/retest/"))
.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}}/targets/:target_id/findings/bulk/retest/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/findings/bulk/retest/")
.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}}/targets/:target_id/findings/bulk/retest/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/findings/bulk/retest/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/bulk/retest/';
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}}/targets/:target_id/findings/bulk/retest/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/bulk/retest/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/bulk/retest/',
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}}/targets/:target_id/findings/bulk/retest/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/targets/:target_id/findings/bulk/retest/');
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}}/targets/:target_id/findings/bulk/retest/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/bulk/retest/';
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}}/targets/:target_id/findings/bulk/retest/"]
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}}/targets/:target_id/findings/bulk/retest/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/bulk/retest/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/targets/:target_id/findings/bulk/retest/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/bulk/retest/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/bulk/retest/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/bulk/retest/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/bulk/retest/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/targets/:target_id/findings/bulk/retest/", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/bulk/retest/"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/bulk/retest/"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/bulk/retest/")
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/targets/:target_id/findings/bulk/retest/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/bulk/retest/";
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}}/targets/:target_id/findings/bulk/retest/
http POST {{baseUrl}}/targets/:target_id/findings/bulk/retest/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/bulk/retest/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/bulk/retest/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Bulk update findings
{{baseUrl}}/targets/:target_id/findings/bulk/update/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/bulk/update/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/findings/bulk/update/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/bulk/update/"
response = HTTP::Client.patch url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/bulk/update/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/bulk/update/");
var request = new RestRequest("", Method.Patch);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/bulk/update/"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/targets/:target_id/findings/bulk/update/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/findings/bulk/update/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/bulk/update/"))
.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}}/targets/:target_id/findings/bulk/update/")
.patch(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/findings/bulk/update/")
.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}}/targets/:target_id/findings/bulk/update/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/bulk/update/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/bulk/update/';
const options = {method: 'PATCH'};
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}}/targets/:target_id/findings/bulk/update/',
method: 'PATCH',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/bulk/update/")
.patch(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/bulk/update/',
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: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/bulk/update/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/findings/bulk/update/');
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}}/targets/:target_id/findings/bulk/update/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/bulk/update/';
const options = {method: 'PATCH'};
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}}/targets/:target_id/findings/bulk/update/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
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}}/targets/:target_id/findings/bulk/update/" in
Client.call `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/bulk/update/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/targets/:target_id/findings/bulk/update/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/bulk/update/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/bulk/update/');
$request->setRequestMethod('PATCH');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/bulk/update/' -Method PATCH
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/bulk/update/' -Method PATCH
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("PATCH", "/baseUrl/targets/:target_id/findings/bulk/update/", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/bulk/update/"
payload = ""
response = requests.patch(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/bulk/update/"
payload <- ""
response <- VERB("PATCH", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/bulk/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/targets/:target_id/findings/bulk/update/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/bulk/update/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/findings/bulk/update/
http PATCH {{baseUrl}}/targets/:target_id/findings/bulk/update/
wget --quiet \
--method PATCH \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/bulk/update/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/bulk/update/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Finding activity log.
{{baseUrl}}/targets/:target_id/findings/:id/log/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/log/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/findings/:id/log/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/log/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/log/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/:id/log/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/log/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/findings/:id/log/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/findings/:id/log/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/log/"))
.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}}/targets/:target_id/findings/:id/log/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/findings/:id/log/")
.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}}/targets/:target_id/findings/:id/log/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/log/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/log/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/log/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/log/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/log/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/log/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/findings/:id/log/');
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}}/targets/:target_id/findings/:id/log/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/log/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/log/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/findings/:id/log/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/log/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/findings/:id/log/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/log/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/log/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/:id/log/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/log/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/findings/:id/log/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/log/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/log/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/log/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/findings/:id/log/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/:id/log/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/findings/:id/log/
http GET {{baseUrl}}/targets/:target_id/findings/:id/log/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/log/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/log/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"changed": "2018-01-31T16:32:17.238553Z"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Finding report
{{baseUrl}}/targets/:target_id/findings/bulk/report/
QUERY PARAMS
target_id
BODY json
{
"ids": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/bulk/report/");
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 \"ids\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/findings/bulk/report/" {:content-type :json
:form-params {:ids []}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/bulk/report/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ids\": []\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}}/targets/:target_id/findings/bulk/report/"),
Content = new StringContent("{\n \"ids\": []\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}}/targets/:target_id/findings/bulk/report/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ids\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/bulk/report/"
payload := strings.NewReader("{\n \"ids\": []\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/targets/:target_id/findings/bulk/report/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 15
{
"ids": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/findings/bulk/report/")
.setHeader("content-type", "application/json")
.setBody("{\n \"ids\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/bulk/report/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ids\": []\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 \"ids\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/bulk/report/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/findings/bulk/report/")
.header("content-type", "application/json")
.body("{\n \"ids\": []\n}")
.asString();
const data = JSON.stringify({
ids: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/findings/bulk/report/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/findings/bulk/report/',
headers: {'content-type': 'application/json'},
data: {ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/bulk/report/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ids":[]}'
};
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}}/targets/:target_id/findings/bulk/report/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ids": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ids\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/bulk/report/")
.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/targets/:target_id/findings/bulk/report/',
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({ids: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/findings/bulk/report/',
headers: {'content-type': 'application/json'},
body: {ids: []},
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}}/targets/:target_id/findings/bulk/report/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ids: []
});
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}}/targets/:target_id/findings/bulk/report/',
headers: {'content-type': 'application/json'},
data: {ids: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/bulk/report/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ids":[]}'
};
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 = @{ @"ids": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/bulk/report/"]
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}}/targets/:target_id/findings/bulk/report/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ids\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/bulk/report/",
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([
'ids' => [
]
]),
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}}/targets/:target_id/findings/bulk/report/', [
'body' => '{
"ids": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/bulk/report/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ids' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ids' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/bulk/report/');
$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}}/targets/:target_id/findings/bulk/report/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ids": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/bulk/report/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ids": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ids\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/findings/bulk/report/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/bulk/report/"
payload = { "ids": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/bulk/report/"
payload <- "{\n \"ids\": []\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}}/targets/:target_id/findings/bulk/report/")
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 \"ids\": []\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/targets/:target_id/findings/bulk/report/') do |req|
req.body = "{\n \"ids\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/bulk/report/";
let payload = json!({"ids": ()});
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}}/targets/:target_id/findings/bulk/report/ \
--header 'content-type: application/json' \
--data '{
"ids": []
}'
echo '{
"ids": []
}' | \
http POST {{baseUrl}}/targets/:target_id/findings/bulk/report/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ids": []\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/bulk/report/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ids": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/bulk/report/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List target findings
{{baseUrl}}/targets/:target_id/findings/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/findings/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/findings/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/findings/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/"))
.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}}/targets/:target_id/findings/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/findings/")
.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}}/targets/:target_id/findings/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/findings/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/findings/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/findings/');
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}}/targets/:target_id/findings/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/findings/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/findings/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/findings/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/findings/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/findings/
http GET {{baseUrl}}/targets/:target_id/findings/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update finding
{{baseUrl}}/targets/:target_id/findings/:id/
QUERY PARAMS
target_id
id
BODY json
{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/");
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 \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/findings/:id/" {:content-type :json
:form-params {:assignee {:email ""
:id ""
:name ""}
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:comment ""
:cvss_score ""
:cvss_vector ""
:definition {:desc ""
:id ""
:name ""}
:evidence ""
:extra ""
:fix ""
:id ""
:insertion_point ""
:labels []
:last_found ""
:method ""
:parameter ""
:params ""
:path ""
:reporter {:email ""
:id ""
:name ""}
:requests [{:request ""
:response ""}]
:scans []
:severity ""
:state ""
:target {:desc ""
:id ""
:name ""
:stack []
:url ""}
:url ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/"),
Content = new StringContent("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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}}/targets/:target_id/findings/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/"
payload := strings.NewReader("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/findings/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 779
{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/findings/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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 \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/findings/:id/")
.header("content-type", "application/json")
.body("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
assignee: {
email: '',
id: '',
name: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {
desc: '',
id: '',
name: ''
},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {
email: '',
id: '',
name: ''
},
requests: [
{
request: '',
response: ''
}
],
scans: [],
severity: '',
state: '',
target: {
desc: '',
id: '',
name: '',
stack: [],
url: ''
},
url: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/:id/',
headers: {'content-type': 'application/json'},
data: {
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"assignee":{"email":"","id":"","name":""},"changed":"","changed_by":{"email":"","id":"","name":""},"comment":"","cvss_score":"","cvss_vector":"","definition":{"desc":"","id":"","name":""},"evidence":"","extra":"","fix":"","id":"","insertion_point":"","labels":[],"last_found":"","method":"","parameter":"","params":"","path":"","reporter":{"email":"","id":"","name":""},"requests":[{"request":"","response":""}],"scans":[],"severity":"","state":"","target":{"desc":"","id":"","name":"","stack":[],"url":""},"url":"","value":""}'
};
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}}/targets/:target_id/findings/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "assignee": {\n "email": "",\n "id": "",\n "name": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "comment": "",\n "cvss_score": "",\n "cvss_vector": "",\n "definition": {\n "desc": "",\n "id": "",\n "name": ""\n },\n "evidence": "",\n "extra": "",\n "fix": "",\n "id": "",\n "insertion_point": "",\n "labels": [],\n "last_found": "",\n "method": "",\n "parameter": "",\n "params": "",\n "path": "",\n "reporter": {\n "email": "",\n "id": "",\n "name": ""\n },\n "requests": [\n {\n "request": "",\n "response": ""\n }\n ],\n "scans": [],\n "severity": "",\n "state": "",\n "target": {\n "desc": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": ""\n },\n "url": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/',
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({
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/:id/',
headers: {'content-type': 'application/json'},
body: {
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
assignee: {
email: '',
id: '',
name: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {
desc: '',
id: '',
name: ''
},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {
email: '',
id: '',
name: ''
},
requests: [
{
request: '',
response: ''
}
],
scans: [],
severity: '',
state: '',
target: {
desc: '',
id: '',
name: '',
stack: [],
url: ''
},
url: '',
value: ''
});
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}}/targets/:target_id/findings/:id/',
headers: {'content-type': 'application/json'},
data: {
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"assignee":{"email":"","id":"","name":""},"changed":"","changed_by":{"email":"","id":"","name":""},"comment":"","cvss_score":"","cvss_vector":"","definition":{"desc":"","id":"","name":""},"evidence":"","extra":"","fix":"","id":"","insertion_point":"","labels":[],"last_found":"","method":"","parameter":"","params":"","path":"","reporter":{"email":"","id":"","name":""},"requests":[{"request":"","response":""}],"scans":[],"severity":"","state":"","target":{"desc":"","id":"","name":"","stack":[],"url":""},"url":"","value":""}'
};
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 = @{ @"assignee": @{ @"email": @"", @"id": @"", @"name": @"" },
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"comment": @"",
@"cvss_score": @"",
@"cvss_vector": @"",
@"definition": @{ @"desc": @"", @"id": @"", @"name": @"" },
@"evidence": @"",
@"extra": @"",
@"fix": @"",
@"id": @"",
@"insertion_point": @"",
@"labels": @[ ],
@"last_found": @"",
@"method": @"",
@"parameter": @"",
@"params": @"",
@"path": @"",
@"reporter": @{ @"email": @"", @"id": @"", @"name": @"" },
@"requests": @[ @{ @"request": @"", @"response": @"" } ],
@"scans": @[ ],
@"severity": @"",
@"state": @"",
@"target": @{ @"desc": @"", @"id": @"", @"name": @"", @"stack": @[ ], @"url": @"" },
@"url": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/findings/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'assignee' => [
'email' => '',
'id' => '',
'name' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'comment' => '',
'cvss_score' => '',
'cvss_vector' => '',
'definition' => [
'desc' => '',
'id' => '',
'name' => ''
],
'evidence' => '',
'extra' => '',
'fix' => '',
'id' => '',
'insertion_point' => '',
'labels' => [
],
'last_found' => '',
'method' => '',
'parameter' => '',
'params' => '',
'path' => '',
'reporter' => [
'email' => '',
'id' => '',
'name' => ''
],
'requests' => [
[
'request' => '',
'response' => ''
]
],
'scans' => [
],
'severity' => '',
'state' => '',
'target' => [
'desc' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => ''
],
'url' => '',
'value' => ''
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/', [
'body' => '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'assignee' => [
'email' => '',
'id' => '',
'name' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'comment' => '',
'cvss_score' => '',
'cvss_vector' => '',
'definition' => [
'desc' => '',
'id' => '',
'name' => ''
],
'evidence' => '',
'extra' => '',
'fix' => '',
'id' => '',
'insertion_point' => '',
'labels' => [
],
'last_found' => '',
'method' => '',
'parameter' => '',
'params' => '',
'path' => '',
'reporter' => [
'email' => '',
'id' => '',
'name' => ''
],
'requests' => [
[
'request' => '',
'response' => ''
]
],
'scans' => [
],
'severity' => '',
'state' => '',
'target' => [
'desc' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => ''
],
'url' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'assignee' => [
'email' => '',
'id' => '',
'name' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'comment' => '',
'cvss_score' => '',
'cvss_vector' => '',
'definition' => [
'desc' => '',
'id' => '',
'name' => ''
],
'evidence' => '',
'extra' => '',
'fix' => '',
'id' => '',
'insertion_point' => '',
'labels' => [
],
'last_found' => '',
'method' => '',
'parameter' => '',
'params' => '',
'path' => '',
'reporter' => [
'email' => '',
'id' => '',
'name' => ''
],
'requests' => [
[
'request' => '',
'response' => ''
]
],
'scans' => [
],
'severity' => '',
'state' => '',
'target' => [
'desc' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => ''
],
'url' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/findings/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/findings/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/"
payload = {
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/"
payload <- "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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.patch('/baseUrl/targets/:target_id/findings/:id/') do |req|
req.body = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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}}/targets/:target_id/findings/:id/";
let payload = json!({
"assignee": json!({
"email": "",
"id": "",
"name": ""
}),
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": json!({
"desc": "",
"id": "",
"name": ""
}),
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": (),
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": json!({
"email": "",
"id": "",
"name": ""
}),
"requests": (
json!({
"request": "",
"response": ""
})
),
"scans": (),
"severity": "",
"state": "",
"target": json!({
"desc": "",
"id": "",
"name": "",
"stack": (),
"url": ""
}),
"url": "",
"value": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/findings/:id/ \
--header 'content-type: application/json' \
--data '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}'
echo '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}' | \
http PATCH {{baseUrl}}/targets/:target_id/findings/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "assignee": {\n "email": "",\n "id": "",\n "name": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "comment": "",\n "cvss_score": "",\n "cvss_vector": "",\n "definition": {\n "desc": "",\n "id": "",\n "name": ""\n },\n "evidence": "",\n "extra": "",\n "fix": "",\n "id": "",\n "insertion_point": "",\n "labels": [],\n "last_found": "",\n "method": "",\n "parameter": "",\n "params": "",\n "path": "",\n "reporter": {\n "email": "",\n "id": "",\n "name": ""\n },\n "requests": [\n {\n "request": "",\n "response": ""\n }\n ],\n "scans": [],\n "severity": "",\n "state": "",\n "target": {\n "desc": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": ""\n },\n "url": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"assignee": [
"email": "",
"id": "",
"name": ""
],
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": [
"desc": "",
"id": "",
"name": ""
],
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": [
"email": "",
"id": "",
"name": ""
],
"requests": [
[
"request": "",
"response": ""
]
],
"scans": [],
"severity": "",
"state": "",
"target": [
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
],
"url": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"assignee": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"cvss_score": 6.5,
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
"id": "jMXUw-BE_2vd",
"last_found": "2018-02-19T18:58:50.906015Z",
"reporter": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Retest finding
{{baseUrl}}/targets/:target_id/findings/:id/retest/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/retest/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/findings/:id/retest/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/retest/"
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}}/targets/:target_id/findings/:id/retest/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/:id/retest/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/retest/"
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/targets/:target_id/findings/:id/retest/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/findings/:id/retest/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/retest/"))
.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}}/targets/:target_id/findings/:id/retest/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/findings/:id/retest/")
.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}}/targets/:target_id/findings/:id/retest/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/findings/:id/retest/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/retest/';
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}}/targets/:target_id/findings/:id/retest/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/retest/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/retest/',
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}}/targets/:target_id/findings/:id/retest/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/targets/:target_id/findings/:id/retest/');
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}}/targets/:target_id/findings/:id/retest/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/retest/';
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}}/targets/:target_id/findings/:id/retest/"]
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}}/targets/:target_id/findings/:id/retest/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/retest/",
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}}/targets/:target_id/findings/:id/retest/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/retest/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/retest/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/:id/retest/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/retest/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/targets/:target_id/findings/:id/retest/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/retest/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/retest/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/retest/")
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/targets/:target_id/findings/:id/retest/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/:id/retest/";
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}}/targets/:target_id/findings/:id/retest/
http POST {{baseUrl}}/targets/:target_id/findings/:id/retest/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/retest/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/retest/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"completed": "2018-01-31T16:32:17.238553Z",
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"scan_profile": "normal",
"started": "2018-01-31T16:32:17.238553Z",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve finding report PDF format
{{baseUrl}}/targets/:target_id/findings/report/
QUERY PARAMS
token
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/report/?token=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/findings/report/" {:query-params {:token ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/report/?token="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/report/?token="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/report/?token=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/report/?token="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/findings/report/?token= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/findings/report/?token=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/report/?token="))
.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}}/targets/:target_id/findings/report/?token=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/findings/report/?token=")
.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}}/targets/:target_id/findings/report/?token=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/report/',
params: {token: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/report/?token=';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/report/?token=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/report/?token=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/report/?token=',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/report/',
qs: {token: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/findings/report/');
req.query({
token: ''
});
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}}/targets/:target_id/findings/report/',
params: {token: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/report/?token=';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/report/?token="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/findings/report/?token=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/report/?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/findings/report/?token=');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/report/');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'token' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/report/');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'token' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/report/?token=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/report/?token=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/findings/report/?token=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/report/"
querystring = {"token":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/report/"
queryString <- list(token = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/report/?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/findings/report/') do |req|
req.params['token'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/report/";
let querystring = [
("token", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/targets/:target_id/findings/report/?token='
http GET '{{baseUrl}}/targets/:target_id/findings/report/?token='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/targets/:target_id/findings/report/?token='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/report/?token=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve finding
{{baseUrl}}/targets/:target_id/findings/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/findings/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/findings/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/findings/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/"))
.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}}/targets/:target_id/findings/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/findings/:id/")
.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}}/targets/:target_id/findings/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/findings/:id/');
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}}/targets/:target_id/findings/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/findings/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/findings/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/findings/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/findings/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/findings/:id/
http GET {{baseUrl}}/targets/:target_id/findings/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"assignee": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"cvss_score": 6.5,
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
"id": "jMXUw-BE_2vd",
"last_found": "2018-02-19T18:58:50.906015Z",
"reporter": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update finding
{{baseUrl}}/targets/:target_id/findings/:id/
QUERY PARAMS
target_id
id
BODY json
{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/");
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 \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/findings/:id/" {:content-type :json
:form-params {:assignee {:email ""
:id ""
:name ""}
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:comment ""
:cvss_score ""
:cvss_vector ""
:definition {:desc ""
:id ""
:name ""}
:evidence ""
:extra ""
:fix ""
:id ""
:insertion_point ""
:labels []
:last_found ""
:method ""
:parameter ""
:params ""
:path ""
:reporter {:email ""
:id ""
:name ""}
:requests [{:request ""
:response ""}]
:scans []
:severity ""
:state ""
:target {:desc ""
:id ""
:name ""
:stack []
:url ""}
:url ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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}}/targets/:target_id/findings/:id/"),
Content = new StringContent("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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}}/targets/:target_id/findings/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/"
payload := strings.NewReader("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/findings/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 779
{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/findings/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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 \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/findings/:id/")
.header("content-type", "application/json")
.body("{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
assignee: {
email: '',
id: '',
name: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {
desc: '',
id: '',
name: ''
},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {
email: '',
id: '',
name: ''
},
requests: [
{
request: '',
response: ''
}
],
scans: [],
severity: '',
state: '',
target: {
desc: '',
id: '',
name: '',
stack: [],
url: ''
},
url: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/findings/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/findings/:id/',
headers: {'content-type': 'application/json'},
data: {
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"assignee":{"email":"","id":"","name":""},"changed":"","changed_by":{"email":"","id":"","name":""},"comment":"","cvss_score":"","cvss_vector":"","definition":{"desc":"","id":"","name":""},"evidence":"","extra":"","fix":"","id":"","insertion_point":"","labels":[],"last_found":"","method":"","parameter":"","params":"","path":"","reporter":{"email":"","id":"","name":""},"requests":[{"request":"","response":""}],"scans":[],"severity":"","state":"","target":{"desc":"","id":"","name":"","stack":[],"url":""},"url":"","value":""}'
};
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}}/targets/:target_id/findings/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "assignee": {\n "email": "",\n "id": "",\n "name": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "comment": "",\n "cvss_score": "",\n "cvss_vector": "",\n "definition": {\n "desc": "",\n "id": "",\n "name": ""\n },\n "evidence": "",\n "extra": "",\n "fix": "",\n "id": "",\n "insertion_point": "",\n "labels": [],\n "last_found": "",\n "method": "",\n "parameter": "",\n "params": "",\n "path": "",\n "reporter": {\n "email": "",\n "id": "",\n "name": ""\n },\n "requests": [\n {\n "request": "",\n "response": ""\n }\n ],\n "scans": [],\n "severity": "",\n "state": "",\n "target": {\n "desc": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": ""\n },\n "url": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/")
.put(body)
.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/targets/:target_id/findings/:id/',
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({
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/findings/:id/',
headers: {'content-type': 'application/json'},
body: {
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
},
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}}/targets/:target_id/findings/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
assignee: {
email: '',
id: '',
name: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {
desc: '',
id: '',
name: ''
},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {
email: '',
id: '',
name: ''
},
requests: [
{
request: '',
response: ''
}
],
scans: [],
severity: '',
state: '',
target: {
desc: '',
id: '',
name: '',
stack: [],
url: ''
},
url: '',
value: ''
});
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}}/targets/:target_id/findings/:id/',
headers: {'content-type': 'application/json'},
data: {
assignee: {email: '', id: '', name: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
comment: '',
cvss_score: '',
cvss_vector: '',
definition: {desc: '', id: '', name: ''},
evidence: '',
extra: '',
fix: '',
id: '',
insertion_point: '',
labels: [],
last_found: '',
method: '',
parameter: '',
params: '',
path: '',
reporter: {email: '', id: '', name: ''},
requests: [{request: '', response: ''}],
scans: [],
severity: '',
state: '',
target: {desc: '', id: '', name: '', stack: [], url: ''},
url: '',
value: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"assignee":{"email":"","id":"","name":""},"changed":"","changed_by":{"email":"","id":"","name":""},"comment":"","cvss_score":"","cvss_vector":"","definition":{"desc":"","id":"","name":""},"evidence":"","extra":"","fix":"","id":"","insertion_point":"","labels":[],"last_found":"","method":"","parameter":"","params":"","path":"","reporter":{"email":"","id":"","name":""},"requests":[{"request":"","response":""}],"scans":[],"severity":"","state":"","target":{"desc":"","id":"","name":"","stack":[],"url":""},"url":"","value":""}'
};
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 = @{ @"assignee": @{ @"email": @"", @"id": @"", @"name": @"" },
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"comment": @"",
@"cvss_score": @"",
@"cvss_vector": @"",
@"definition": @{ @"desc": @"", @"id": @"", @"name": @"" },
@"evidence": @"",
@"extra": @"",
@"fix": @"",
@"id": @"",
@"insertion_point": @"",
@"labels": @[ ],
@"last_found": @"",
@"method": @"",
@"parameter": @"",
@"params": @"",
@"path": @"",
@"reporter": @{ @"email": @"", @"id": @"", @"name": @"" },
@"requests": @[ @{ @"request": @"", @"response": @"" } ],
@"scans": @[ ],
@"severity": @"",
@"state": @"",
@"target": @{ @"desc": @"", @"id": @"", @"name": @"", @"stack": @[ ], @"url": @"" },
@"url": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/:id/"]
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}}/targets/:target_id/findings/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/",
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([
'assignee' => [
'email' => '',
'id' => '',
'name' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'comment' => '',
'cvss_score' => '',
'cvss_vector' => '',
'definition' => [
'desc' => '',
'id' => '',
'name' => ''
],
'evidence' => '',
'extra' => '',
'fix' => '',
'id' => '',
'insertion_point' => '',
'labels' => [
],
'last_found' => '',
'method' => '',
'parameter' => '',
'params' => '',
'path' => '',
'reporter' => [
'email' => '',
'id' => '',
'name' => ''
],
'requests' => [
[
'request' => '',
'response' => ''
]
],
'scans' => [
],
'severity' => '',
'state' => '',
'target' => [
'desc' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => ''
],
'url' => '',
'value' => ''
]),
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('PUT', '{{baseUrl}}/targets/:target_id/findings/:id/', [
'body' => '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'assignee' => [
'email' => '',
'id' => '',
'name' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'comment' => '',
'cvss_score' => '',
'cvss_vector' => '',
'definition' => [
'desc' => '',
'id' => '',
'name' => ''
],
'evidence' => '',
'extra' => '',
'fix' => '',
'id' => '',
'insertion_point' => '',
'labels' => [
],
'last_found' => '',
'method' => '',
'parameter' => '',
'params' => '',
'path' => '',
'reporter' => [
'email' => '',
'id' => '',
'name' => ''
],
'requests' => [
[
'request' => '',
'response' => ''
]
],
'scans' => [
],
'severity' => '',
'state' => '',
'target' => [
'desc' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => ''
],
'url' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'assignee' => [
'email' => '',
'id' => '',
'name' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'comment' => '',
'cvss_score' => '',
'cvss_vector' => '',
'definition' => [
'desc' => '',
'id' => '',
'name' => ''
],
'evidence' => '',
'extra' => '',
'fix' => '',
'id' => '',
'insertion_point' => '',
'labels' => [
],
'last_found' => '',
'method' => '',
'parameter' => '',
'params' => '',
'path' => '',
'reporter' => [
'email' => '',
'id' => '',
'name' => ''
],
'requests' => [
[
'request' => '',
'response' => ''
]
],
'scans' => [
],
'severity' => '',
'state' => '',
'target' => [
'desc' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => ''
],
'url' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/findings/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/findings/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/"
payload = {
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/"
payload <- "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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/targets/:target_id/findings/:id/') do |req|
req.body = "{\n \"assignee\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"comment\": \"\",\n \"cvss_score\": \"\",\n \"cvss_vector\": \"\",\n \"definition\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"evidence\": \"\",\n \"extra\": \"\",\n \"fix\": \"\",\n \"id\": \"\",\n \"insertion_point\": \"\",\n \"labels\": [],\n \"last_found\": \"\",\n \"method\": \"\",\n \"parameter\": \"\",\n \"params\": \"\",\n \"path\": \"\",\n \"reporter\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"requests\": [\n {\n \"request\": \"\",\n \"response\": \"\"\n }\n ],\n \"scans\": [],\n \"severity\": \"\",\n \"state\": \"\",\n \"target\": {\n \"desc\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\"\n },\n \"url\": \"\",\n \"value\": \"\"\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}}/targets/:target_id/findings/:id/";
let payload = json!({
"assignee": json!({
"email": "",
"id": "",
"name": ""
}),
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": json!({
"desc": "",
"id": "",
"name": ""
}),
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": (),
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": json!({
"email": "",
"id": "",
"name": ""
}),
"requests": (
json!({
"request": "",
"response": ""
})
),
"scans": (),
"severity": "",
"state": "",
"target": json!({
"desc": "",
"id": "",
"name": "",
"stack": (),
"url": ""
}),
"url": "",
"value": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/findings/:id/ \
--header 'content-type: application/json' \
--data '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}'
echo '{
"assignee": {
"email": "",
"id": "",
"name": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": {
"desc": "",
"id": "",
"name": ""
},
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": {
"email": "",
"id": "",
"name": ""
},
"requests": [
{
"request": "",
"response": ""
}
],
"scans": [],
"severity": "",
"state": "",
"target": {
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
},
"url": "",
"value": ""
}' | \
http PUT {{baseUrl}}/targets/:target_id/findings/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "assignee": {\n "email": "",\n "id": "",\n "name": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "comment": "",\n "cvss_score": "",\n "cvss_vector": "",\n "definition": {\n "desc": "",\n "id": "",\n "name": ""\n },\n "evidence": "",\n "extra": "",\n "fix": "",\n "id": "",\n "insertion_point": "",\n "labels": [],\n "last_found": "",\n "method": "",\n "parameter": "",\n "params": "",\n "path": "",\n "reporter": {\n "email": "",\n "id": "",\n "name": ""\n },\n "requests": [\n {\n "request": "",\n "response": ""\n }\n ],\n "scans": [],\n "severity": "",\n "state": "",\n "target": {\n "desc": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": ""\n },\n "url": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"assignee": [
"email": "",
"id": "",
"name": ""
],
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"comment": "",
"cvss_score": "",
"cvss_vector": "",
"definition": [
"desc": "",
"id": "",
"name": ""
],
"evidence": "",
"extra": "",
"fix": "",
"id": "",
"insertion_point": "",
"labels": [],
"last_found": "",
"method": "",
"parameter": "",
"params": "",
"path": "",
"reporter": [
"email": "",
"id": "",
"name": ""
],
"requests": [
[
"request": "",
"response": ""
]
],
"scans": [],
"severity": "",
"state": "",
"target": [
"desc": "",
"id": "",
"name": "",
"stack": [],
"url": ""
],
"url": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"assignee": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"cvss_score": 6.5,
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
"id": "jMXUw-BE_2vd",
"last_found": "2018-02-19T18:58:50.906015Z",
"reporter": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List frameworks
{{baseUrl}}/frameworks/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/frameworks/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/frameworks/")
require "http/client"
url = "{{baseUrl}}/frameworks/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/frameworks/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/frameworks/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/frameworks/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/frameworks/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/frameworks/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/frameworks/"))
.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}}/frameworks/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/frameworks/")
.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}}/frameworks/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/frameworks/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/frameworks/';
const options = {method: 'GET'};
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}}/frameworks/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/frameworks/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/frameworks/',
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: 'GET', url: '{{baseUrl}}/frameworks/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/frameworks/');
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}}/frameworks/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/frameworks/';
const options = {method: 'GET'};
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}}/frameworks/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/frameworks/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/frameworks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/frameworks/');
echo $response->getBody();
setUrl('{{baseUrl}}/frameworks/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/frameworks/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/frameworks/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/frameworks/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/frameworks/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/frameworks/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/frameworks/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/frameworks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/frameworks/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/frameworks/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/frameworks/
http GET {{baseUrl}}/frameworks/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/frameworks/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/frameworks/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve framework
{{baseUrl}}/frameworks/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/frameworks/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/frameworks/:id/")
require "http/client"
url = "{{baseUrl}}/frameworks/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/frameworks/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/frameworks/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/frameworks/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/frameworks/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/frameworks/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/frameworks/:id/"))
.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}}/frameworks/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/frameworks/:id/")
.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}}/frameworks/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/frameworks/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/frameworks/:id/';
const options = {method: 'GET'};
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}}/frameworks/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/frameworks/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/frameworks/:id/',
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: 'GET', url: '{{baseUrl}}/frameworks/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/frameworks/:id/');
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}}/frameworks/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/frameworks/:id/';
const options = {method: 'GET'};
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}}/frameworks/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/frameworks/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/frameworks/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/frameworks/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/frameworks/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/frameworks/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/frameworks/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/frameworks/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/frameworks/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/frameworks/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/frameworks/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/frameworks/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/frameworks/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/frameworks/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/frameworks/:id/
http GET {{baseUrl}}/frameworks/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/frameworks/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/frameworks/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"name": "jMXUw-BE_2vd"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Integrations available and installed for the target
{{baseUrl}}/targets/:target_id/integrations/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/integrations/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/integrations/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/integrations/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/integrations/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/"))
.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}}/targets/:target_id/integrations/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/integrations/")
.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}}/targets/:target_id/integrations/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/integrations/');
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}}/targets/:target_id/integrations/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/integrations/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/integrations/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/integrations/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/integrations/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/integrations/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/integrations/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/integrations/
http GET {{baseUrl}}/targets/:target_id/integrations/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Integrations available and installed in the account
{{baseUrl}}/integrations/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/")
require "http/client"
url = "{{baseUrl}}/integrations/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/"))
.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}}/integrations/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/")
.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}}/integrations/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/integrations/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/';
const options = {method: 'GET'};
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}}/integrations/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/',
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: 'GET', url: '{{baseUrl}}/integrations/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/');
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}}/integrations/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/';
const options = {method: 'GET'};
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}}/integrations/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/
http GET {{baseUrl}}/integrations/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List Jira Projects
{{baseUrl}}/integrations/jira-cloud/projects/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-cloud/projects/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-cloud/projects/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-cloud/projects/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-cloud/projects/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-cloud/projects/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-cloud/projects/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-cloud/projects/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-cloud/projects/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-cloud/projects/"))
.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}}/integrations/jira-cloud/projects/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-cloud/projects/")
.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}}/integrations/jira-cloud/projects/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-cloud/projects/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-cloud/projects/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-cloud/projects/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-cloud/projects/');
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}}/integrations/jira-cloud/projects/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-cloud/projects/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-cloud/projects/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-cloud/projects/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-cloud/projects/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-cloud/projects/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-cloud/projects/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-cloud/projects/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-cloud/projects/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-cloud/projects/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-cloud/projects/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-cloud/projects/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-cloud/projects/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-cloud/projects/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-cloud/projects/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-cloud/projects/
http GET {{baseUrl}}/integrations/jira-cloud/projects/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-cloud/projects/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-cloud/projects/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "10001",
"name": "Project"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve Jira Cloud Target configuration
{{baseUrl}}/targets/:target_id/integrations/jira-cloud/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/integrations/jira-cloud/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"))
.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}}/targets/:target_id/integrations/jira-cloud/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.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}}/targets/:target_id/integrations/jira-cloud/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/jira-cloud/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/jira-cloud/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
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}}/targets/:target_id/integrations/jira-cloud/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/jira-cloud/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/integrations/jira-cloud/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/jira-cloud/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/integrations/jira-cloud/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/integrations/jira-cloud/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/integrations/jira-cloud/
http GET {{baseUrl}}/targets/:target_id/integrations/jira-cloud/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/jira-cloud/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve Jira Cloud finding configuration
{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"))
.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}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.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}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
http GET {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve issue priorities
{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/
QUERY PARAMS
project_id
issue_type_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"))
.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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
.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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/');
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/
http GET {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/priorities/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "3",
"name": "Medium"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve issue statuses
{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/
QUERY PARAMS
project_id
issue_type_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"))
.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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
.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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/');
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/
http GET {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/:issue_type_id/status/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "10003",
"name": "Backlog"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve project issue types
{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/
QUERY PARAMS
project_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/"))
.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}}/integrations/jira-cloud/projects/:project_id/issue_types/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/")
.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}}/integrations/jira-cloud/projects/:project_id/issue_types/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/:project_id/issue_types/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/');
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}}/integrations/jira-cloud/projects/:project_id/issue_types/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/';
const options = {method: 'GET'};
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}}/integrations/jira-cloud/projects/:project_id/issue_types/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-cloud/projects/:project_id/issue_types/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-cloud/projects/:project_id/issue_types/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/
http GET {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-cloud/projects/:project_id/issue_types/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "10003",
"name": "Story"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update Jira Cloud finding configuration (PUT)
{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
QUERY PARAMS
target_id
id
BODY json
{
"issue_id": "",
"selective_sync": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/");
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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/" {:content-type :json
:form-params {:issue_id ""
:selective_sync false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-cloud/"),
Content = new StringContent("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-cloud/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
payload := strings.NewReader("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"issue_id": "",
"selective_sync": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.setHeader("content-type", "application/json")
.setBody("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.header("content-type", "application/json")
.body("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.asString();
const data = JSON.stringify({
issue_id: '',
selective_sync: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "issue_id": "",\n "selective_sync": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.put(body)
.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/targets/:target_id/findings/:id/integrations/jira-cloud/',
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({issue_id: '', selective_sync: false}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
body: {issue_id: '', selective_sync: false},
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
issue_id: '',
selective_sync: false
});
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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 = @{ @"issue_id": @"",
@"selective_sync": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"]
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/",
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([
'issue_id' => '',
'selective_sync' => null
]),
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('PUT', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/', [
'body' => '{
"issue_id": "",
"selective_sync": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/findings/:id/integrations/jira-cloud/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
payload = {
"issue_id": "",
"selective_sync": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
payload <- "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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/targets/:target_id/findings/:id/integrations/jira-cloud/') do |req|
req.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-cloud/";
let payload = json!({
"issue_id": "",
"selective_sync": false
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/ \
--header 'content-type: application/json' \
--data '{
"issue_id": "",
"selective_sync": false
}'
echo '{
"issue_id": "",
"selective_sync": false
}' | \
http PUT {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "issue_id": "",\n "selective_sync": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"issue_id": "",
"selective_sync": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Update Jira Cloud finding configuration
{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
QUERY PARAMS
target_id
id
BODY json
{
"issue_id": "",
"selective_sync": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/");
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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/" {:content-type :json
:form-params {:issue_id ""
:selective_sync false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"),
Content = new StringContent("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-cloud/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
payload := strings.NewReader("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"issue_id": "",
"selective_sync": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.setHeader("content-type", "application/json")
.setBody("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.header("content-type", "application/json")
.body("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.asString();
const data = JSON.stringify({
issue_id: '',
selective_sync: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "issue_id": "",\n "selective_sync": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/',
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({issue_id: '', selective_sync: false}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
body: {issue_id: '', selective_sync: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
issue_id: '',
selective_sync: false
});
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}}/targets/:target_id/findings/:id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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 = @{ @"issue_id": @"",
@"selective_sync": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/findings/:id/integrations/jira-cloud/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'issue_id' => '',
'selective_sync' => null
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/', [
'body' => '{
"issue_id": "",
"selective_sync": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/findings/:id/integrations/jira-cloud/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
payload = {
"issue_id": "",
"selective_sync": False
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/"
payload <- "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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.patch('/baseUrl/targets/:target_id/findings/:id/integrations/jira-cloud/') do |req|
req.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-cloud/";
let payload = json!({
"issue_id": "",
"selective_sync": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/ \
--header 'content-type: application/json' \
--data '{
"issue_id": "",
"selective_sync": false
}'
echo '{
"issue_id": "",
"selective_sync": false
}' | \
http PATCH {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "issue_id": "",\n "selective_sync": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"issue_id": "",
"selective_sync": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-cloud/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update Jira Cloud target configuration (PUT)
{{baseUrl}}/targets/:target_id/integrations/jira-cloud/
QUERY PARAMS
target_id
BODY json
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/");
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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/" {:content-type :json
:form-params {:allow_jira false
:auto_sync false
:issue_type_id ""
:priority_mapping {:10 ""
:20 ""
:30 ""}
:project_id ""
:status_mapping {:accepted ""
:fixed ""
:invalid ""
:notfixed ""}}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-cloud/"),
Content = new StringContent("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-cloud/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
payload := strings.NewReader("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/integrations/jira-cloud/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 262
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.header("content-type", "application/json")
.body("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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}}/targets/:target_id/integrations/jira-cloud/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.put(body)
.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/targets/:target_id/integrations/jira-cloud/',
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({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
body: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
},
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}}/targets/:target_id/integrations/jira-cloud/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
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}}/targets/:target_id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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 = @{ @"allow_jira": @NO,
@"auto_sync": @NO,
@"issue_type_id": @"",
@"priority_mapping": @{ @"10": @"", @"20": @"", @"30": @"" },
@"project_id": @"",
@"status_mapping": @{ @"accepted": @"", @"fixed": @"", @"invalid": @"", @"notfixed": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"]
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}}/targets/:target_id/integrations/jira-cloud/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/jira-cloud/",
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([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]),
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('PUT', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/', [
'body' => '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/integrations/jira-cloud/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/integrations/jira-cloud/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
payload = {
"allow_jira": False,
"auto_sync": False,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
payload <- "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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/targets/:target_id/integrations/jira-cloud/') do |req|
req.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-cloud/";
let payload = json!({
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": json!({
"10": "",
"20": "",
"30": ""
}),
"project_id": "",
"status_mapping": json!({
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/integrations/jira-cloud/ \
--header 'content-type: application/json' \
--data '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
echo '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}' | \
http PUT {{baseUrl}}/targets/:target_id/integrations/jira-cloud/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\n }\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/jira-cloud/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": [
"10": "",
"20": "",
"30": ""
],
"project_id": "",
"status_mapping": [
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Update Jira Cloud target configuration
{{baseUrl}}/targets/:target_id/integrations/jira-cloud/
QUERY PARAMS
target_id
BODY json
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/");
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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/" {:content-type :json
:form-params {:allow_jira false
:auto_sync false
:issue_type_id ""
:priority_mapping {:10 ""
:20 ""
:30 ""}
:project_id ""
:status_mapping {:accepted ""
:fixed ""
:invalid ""
:notfixed ""}}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"),
Content = new StringContent("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-cloud/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
payload := strings.NewReader("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/integrations/jira-cloud/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 262
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.header("content-type", "application/json")
.body("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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}}/targets/:target_id/integrations/jira-cloud/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/jira-cloud/',
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({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
body: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
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}}/targets/:target_id/integrations/jira-cloud/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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 = @{ @"allow_jira": @NO,
@"auto_sync": @NO,
@"issue_type_id": @"",
@"priority_mapping": @{ @"10": @"", @"20": @"", @"30": @"" },
@"project_id": @"",
@"status_mapping": @{ @"accepted": @"", @"fixed": @"", @"invalid": @"", @"notfixed": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/integrations/jira-cloud/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/jira-cloud/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/', [
'body' => '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/jira-cloud/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/integrations/jira-cloud/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-cloud/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/integrations/jira-cloud/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
payload = {
"allow_jira": False,
"auto_sync": False,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/"
payload <- "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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.patch('/baseUrl/targets/:target_id/integrations/jira-cloud/') do |req|
req.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-cloud/";
let payload = json!({
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": json!({
"10": "",
"20": "",
"30": ""
}),
"project_id": "",
"status_mapping": json!({
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/integrations/jira-cloud/ \
--header 'content-type: application/json' \
--data '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
echo '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}' | \
http PATCH {{baseUrl}}/targets/:target_id/integrations/jira-cloud/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\n }\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/jira-cloud/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": [
"10": "",
"20": "",
"30": ""
],
"project_id": "",
"status_mapping": [
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/jira-cloud/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List Jira Projects (GET)
{{baseUrl}}/integrations/jira-server/projects/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-server/projects/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-server/projects/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-server/projects/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-server/projects/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-server/projects/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-server/projects/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-server/projects/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-server/projects/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-server/projects/"))
.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}}/integrations/jira-server/projects/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-server/projects/")
.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}}/integrations/jira-server/projects/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-server/projects/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-server/projects/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-server/projects/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-server/projects/');
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}}/integrations/jira-server/projects/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-server/projects/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-server/projects/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-server/projects/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-server/projects/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-server/projects/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-server/projects/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-server/projects/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-server/projects/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-server/projects/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-server/projects/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-server/projects/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-server/projects/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-server/projects/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-server/projects/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-server/projects/
http GET {{baseUrl}}/integrations/jira-server/projects/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-server/projects/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-server/projects/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "10001",
"name": "Project"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve Jira Server Target configuration
{{baseUrl}}/targets/:target_id/integrations/jira-server/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/jira-server/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/integrations/jira-server/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/jira-server/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/integrations/jira-server/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/integrations/jira-server/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/jira-server/"))
.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}}/targets/:target_id/integrations/jira-server/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.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}}/targets/:target_id/integrations/jira-server/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-server/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-server/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/jira-server/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/jira-server/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-server/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/integrations/jira-server/');
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}}/targets/:target_id/integrations/jira-server/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-server/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/jira-server/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/integrations/jira-server/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/jira-server/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/integrations/jira-server/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/jira-server/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/jira-server/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-server/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-server/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/integrations/jira-server/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/integrations/jira-server/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/integrations/jira-server/
http GET {{baseUrl}}/targets/:target_id/integrations/jira-server/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/jira-server/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/jira-server/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve Jira Server finding configuration
{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/findings/:id/integrations/jira-server/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"))
.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}}/targets/:target_id/findings/:id/integrations/jira-server/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.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}}/targets/:target_id/findings/:id/integrations/jira-server/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/integrations/jira-server/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
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}}/targets/:target_id/findings/:id/integrations/jira-server/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/';
const options = {method: 'GET'};
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}}/targets/:target_id/findings/:id/integrations/jira-server/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/findings/:id/integrations/jira-server/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
http GET {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve issue priorities (GET)
{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/
QUERY PARAMS
project_id
issue_type_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"))
.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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
.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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/');
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/
http GET {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/priorities/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "3",
"name": "Medium"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve issue statuses (GET)
{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/
QUERY PARAMS
project_id
issue_type_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"))
.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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
.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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/');
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/
http GET {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/:issue_type_id/status/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "10003",
"name": "Backlog"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve project issue types (GET)
{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/
QUERY PARAMS
project_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/")
require "http/client"
url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/integrations/jira-server/projects/:project_id/issue_types/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/"))
.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}}/integrations/jira-server/projects/:project_id/issue_types/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/")
.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}}/integrations/jira-server/projects/:project_id/issue_types/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/:project_id/issue_types/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/integrations/jira-server/projects/:project_id/issue_types/',
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: 'GET',
url: '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/');
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}}/integrations/jira-server/projects/:project_id/issue_types/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/';
const options = {method: 'GET'};
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}}/integrations/jira-server/projects/:project_id/issue_types/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/integrations/jira-server/projects/:project_id/issue_types/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/');
echo $response->getBody();
setUrl('{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/integrations/jira-server/projects/:project_id/issue_types/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/integrations/jira-server/projects/:project_id/issue_types/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/
http GET {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/integrations/jira-server/projects/:project_id/issue_types/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "10003",
"name": "Story"
}
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update Jira Server finding configuration (PUT)
{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
QUERY PARAMS
target_id
id
BODY json
{
"issue_id": "",
"selective_sync": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/");
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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/" {:content-type :json
:form-params {:issue_id ""
:selective_sync false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-server/"),
Content = new StringContent("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-server/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
payload := strings.NewReader("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/findings/:id/integrations/jira-server/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"issue_id": "",
"selective_sync": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.setHeader("content-type", "application/json")
.setBody("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.header("content-type", "application/json")
.body("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.asString();
const data = JSON.stringify({
issue_id: '',
selective_sync: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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}}/targets/:target_id/findings/:id/integrations/jira-server/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "issue_id": "",\n "selective_sync": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.put(body)
.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/targets/:target_id/findings/:id/integrations/jira-server/',
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({issue_id: '', selective_sync: false}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
body: {issue_id: '', selective_sync: false},
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}}/targets/:target_id/findings/:id/integrations/jira-server/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
issue_id: '',
selective_sync: false
});
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}}/targets/:target_id/findings/:id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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 = @{ @"issue_id": @"",
@"selective_sync": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"]
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}}/targets/:target_id/findings/:id/integrations/jira-server/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/",
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([
'issue_id' => '',
'selective_sync' => null
]),
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('PUT', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/', [
'body' => '{
"issue_id": "",
"selective_sync": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/findings/:id/integrations/jira-server/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
payload = {
"issue_id": "",
"selective_sync": False
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
payload <- "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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/targets/:target_id/findings/:id/integrations/jira-server/') do |req|
req.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-server/";
let payload = json!({
"issue_id": "",
"selective_sync": false
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/findings/:id/integrations/jira-server/ \
--header 'content-type: application/json' \
--data '{
"issue_id": "",
"selective_sync": false
}'
echo '{
"issue_id": "",
"selective_sync": false
}' | \
http PUT {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "issue_id": "",\n "selective_sync": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"issue_id": "",
"selective_sync": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Update Jira Server finding configuration
{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
QUERY PARAMS
target_id
id
BODY json
{
"issue_id": "",
"selective_sync": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/");
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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/" {:content-type :json
:form-params {:issue_id ""
:selective_sync false}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"),
Content = new StringContent("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-server/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
payload := strings.NewReader("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/findings/:id/integrations/jira-server/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"issue_id": "",
"selective_sync": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.setHeader("content-type", "application/json")
.setBody("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"issue_id\": \"\",\n \"selective_sync\": false\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 \"issue_id\": \"\",\n \"selective_sync\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.header("content-type", "application/json")
.body("{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
.asString();
const data = JSON.stringify({
issue_id: '',
selective_sync: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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}}/targets/:target_id/findings/:id/integrations/jira-server/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "issue_id": "",\n "selective_sync": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/',
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({issue_id: '', selective_sync: false}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
body: {issue_id: '', selective_sync: false},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
issue_id: '',
selective_sync: false
});
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}}/targets/:target_id/findings/:id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {issue_id: '', selective_sync: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"issue_id":"","selective_sync":false}'
};
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 = @{ @"issue_id": @"",
@"selective_sync": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/findings/:id/integrations/jira-server/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'issue_id' => '',
'selective_sync' => null
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/', [
'body' => '{
"issue_id": "",
"selective_sync": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'issue_id' => '',
'selective_sync' => null
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/findings/:id/integrations/jira-server/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"issue_id": "",
"selective_sync": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
payload = {
"issue_id": "",
"selective_sync": False
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/"
payload <- "{\n \"issue_id\": \"\",\n \"selective_sync\": false\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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.patch('/baseUrl/targets/:target_id/findings/:id/integrations/jira-server/') do |req|
req.body = "{\n \"issue_id\": \"\",\n \"selective_sync\": false\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}}/targets/:target_id/findings/:id/integrations/jira-server/";
let payload = json!({
"issue_id": "",
"selective_sync": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/ \
--header 'content-type: application/json' \
--data '{
"issue_id": "",
"selective_sync": false
}'
echo '{
"issue_id": "",
"selective_sync": false
}' | \
http PATCH {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "issue_id": "",\n "selective_sync": false\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"issue_id": "",
"selective_sync": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/findings/:id/integrations/jira-server/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update Jira Server target configuration (PUT)
{{baseUrl}}/targets/:target_id/integrations/jira-server/
QUERY PARAMS
target_id
BODY json
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/jira-server/");
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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/integrations/jira-server/" {:content-type :json
:form-params {:allow_jira false
:auto_sync false
:issue_type_id ""
:priority_mapping {:10 ""
:20 ""
:30 ""}
:project_id ""
:status_mapping {:accepted ""
:fixed ""
:invalid ""
:notfixed ""}}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-server/"),
Content = new StringContent("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-server/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
payload := strings.NewReader("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/integrations/jira-server/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 262
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/jira-server/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.header("content-type", "application/json")
.body("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/integrations/jira-server/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-server/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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}}/targets/:target_id/integrations/jira-server/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.put(body)
.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/targets/:target_id/integrations/jira-server/',
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({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
body: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
},
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}}/targets/:target_id/integrations/jira-server/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
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}}/targets/:target_id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-server/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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 = @{ @"allow_jira": @NO,
@"auto_sync": @NO,
@"issue_type_id": @"",
@"priority_mapping": @{ @"10": @"", @"20": @"", @"30": @"" },
@"project_id": @"",
@"status_mapping": @{ @"accepted": @"", @"fixed": @"", @"invalid": @"", @"notfixed": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/integrations/jira-server/"]
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}}/targets/:target_id/integrations/jira-server/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/jira-server/",
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([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]),
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('PUT', '{{baseUrl}}/targets/:target_id/integrations/jira-server/', [
'body' => '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/jira-server/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/jira-server/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/integrations/jira-server/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-server/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/integrations/jira-server/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
payload = {
"allow_jira": False,
"auto_sync": False,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
payload <- "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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/targets/:target_id/integrations/jira-server/') do |req|
req.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-server/";
let payload = json!({
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": json!({
"10": "",
"20": "",
"30": ""
}),
"project_id": "",
"status_mapping": json!({
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/integrations/jira-server/ \
--header 'content-type: application/json' \
--data '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
echo '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}' | \
http PUT {{baseUrl}}/targets/:target_id/integrations/jira-server/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\n }\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/jira-server/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": [
"10": "",
"20": "",
"30": ""
],
"project_id": "",
"status_mapping": [
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/jira-server/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Update Jira Server target configuration
{{baseUrl}}/targets/:target_id/integrations/jira-server/
QUERY PARAMS
target_id
BODY json
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/jira-server/");
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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/integrations/jira-server/" {:content-type :json
:form-params {:allow_jira false
:auto_sync false
:issue_type_id ""
:priority_mapping {:10 ""
:20 ""
:30 ""}
:project_id ""
:status_mapping {:accepted ""
:fixed ""
:invalid ""
:notfixed ""}}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/jira-server/"),
Content = new StringContent("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-server/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
payload := strings.NewReader("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/integrations/jira-server/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 262
{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/jira-server/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.header("content-type", "application/json")
.body("{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/integrations/jira-server/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-server/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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}}/targets/:target_id/integrations/jira-server/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\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 \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/jira-server/',
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({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
body: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/integrations/jira-server/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {
'10': '',
'20': '',
'30': ''
},
project_id: '',
status_mapping: {
accepted: '',
fixed: '',
invalid: '',
notfixed: ''
}
});
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}}/targets/:target_id/integrations/jira-server/',
headers: {'content-type': 'application/json'},
data: {
allow_jira: false,
auto_sync: false,
issue_type_id: '',
priority_mapping: {'10': '', '20': '', '30': ''},
project_id: '',
status_mapping: {accepted: '', fixed: '', invalid: '', notfixed: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/jira-server/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"allow_jira":false,"auto_sync":false,"issue_type_id":"","priority_mapping":{"10":"","20":"","30":""},"project_id":"","status_mapping":{"accepted":"","fixed":"","invalid":"","notfixed":""}}'
};
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 = @{ @"allow_jira": @NO,
@"auto_sync": @NO,
@"issue_type_id": @"",
@"priority_mapping": @{ @"10": @"", @"20": @"", @"30": @"" },
@"project_id": @"",
@"status_mapping": @{ @"accepted": @"", @"fixed": @"", @"invalid": @"", @"notfixed": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/integrations/jira-server/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/integrations/jira-server/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/jira-server/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/integrations/jira-server/', [
'body' => '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/jira-server/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allow_jira' => null,
'auto_sync' => null,
'issue_type_id' => '',
'priority_mapping' => [
'10' => '',
'20' => '',
'30' => ''
],
'project_id' => '',
'status_mapping' => [
'accepted' => '',
'fixed' => '',
'invalid' => '',
'notfixed' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/jira-server/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/integrations/jira-server/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/jira-server/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/integrations/jira-server/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
payload = {
"allow_jira": False,
"auto_sync": False,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/jira-server/"
payload <- "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/jira-server/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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.patch('/baseUrl/targets/:target_id/integrations/jira-server/') do |req|
req.body = "{\n \"allow_jira\": false,\n \"auto_sync\": false,\n \"issue_type_id\": \"\",\n \"priority_mapping\": {\n \"10\": \"\",\n \"20\": \"\",\n \"30\": \"\"\n },\n \"project_id\": \"\",\n \"status_mapping\": {\n \"accepted\": \"\",\n \"fixed\": \"\",\n \"invalid\": \"\",\n \"notfixed\": \"\"\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}}/targets/:target_id/integrations/jira-server/";
let payload = json!({
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": json!({
"10": "",
"20": "",
"30": ""
}),
"project_id": "",
"status_mapping": json!({
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/integrations/jira-server/ \
--header 'content-type: application/json' \
--data '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}'
echo '{
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": {
"10": "",
"20": "",
"30": ""
},
"project_id": "",
"status_mapping": {
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
}
}' | \
http PATCH {{baseUrl}}/targets/:target_id/integrations/jira-server/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "allow_jira": false,\n "auto_sync": false,\n "issue_type_id": "",\n "priority_mapping": {\n "10": "",\n "20": "",\n "30": ""\n },\n "project_id": "",\n "status_mapping": {\n "accepted": "",\n "fixed": "",\n "invalid": "",\n "notfixed": ""\n }\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/jira-server/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allow_jira": false,
"auto_sync": false,
"issue_type_id": "",
"priority_mapping": [
"10": "",
"20": "",
"30": ""
],
"project_id": "",
"status_mapping": [
"accepted": "",
"fixed": "",
"invalid": "",
"notfixed": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/jira-server/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create label
{{baseUrl}}/labels/
BODY json
{
"id": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/labels/");
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 \"id\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/labels/" {:content-type :json
:form-params {:id ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/labels/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\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}}/labels/"),
Content = new StringContent("{\n \"id\": \"\",\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}}/labels/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/labels/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"name\": \"\"\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/labels/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"id": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/labels/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/labels/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\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 \"id\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/labels/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/labels/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
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}}/labels/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/labels/',
headers: {'content-type': 'application/json'},
data: {id: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/labels/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","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}}/labels/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\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 \"id\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/labels/")
.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/labels/',
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({id: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/labels/',
headers: {'content-type': 'application/json'},
body: {id: '', 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}}/labels/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
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}}/labels/',
headers: {'content-type': 'application/json'},
data: {id: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/labels/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","name":""}'
};
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 = @{ @"id": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/labels/"]
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}}/labels/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/labels/",
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([
'id' => '',
'name' => ''
]),
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}}/labels/', [
'body' => '{
"id": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/labels/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/labels/');
$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}}/labels/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/labels/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/labels/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/labels/"
payload = {
"id": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/labels/"
payload <- "{\n \"id\": \"\",\n \"name\": \"\"\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}}/labels/")
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 \"id\": \"\",\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/labels/') do |req|
req.body = "{\n \"id\": \"\",\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}}/labels/";
let payload = json!({
"id": "",
"name": ""
});
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}}/labels/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"name": ""
}'
echo '{
"id": "",
"name": ""
}' | \
http POST {{baseUrl}}/labels/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/labels/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/labels/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete label
{{baseUrl}}/labels/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/labels/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/labels/:id/")
require "http/client"
url = "{{baseUrl}}/labels/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/labels/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/labels/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/labels/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/labels/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/labels/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/labels/:id/"))
.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}}/labels/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/labels/:id/")
.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}}/labels/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/labels/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/labels/:id/';
const options = {method: 'DELETE'};
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}}/labels/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/labels/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/labels/:id/',
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: 'DELETE', url: '{{baseUrl}}/labels/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/labels/:id/');
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}}/labels/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/labels/:id/';
const options = {method: 'DELETE'};
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}}/labels/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/labels/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/labels/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/labels/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/labels/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/labels/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/labels/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/labels/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/labels/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/labels/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/labels/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/labels/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/labels/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/labels/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/labels/:id/
http DELETE {{baseUrl}}/labels/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/labels/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/labels/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List labels
{{baseUrl}}/labels/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/labels/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/labels/")
require "http/client"
url = "{{baseUrl}}/labels/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/labels/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/labels/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/labels/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/labels/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/labels/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/labels/"))
.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}}/labels/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/labels/")
.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}}/labels/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/labels/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/labels/';
const options = {method: 'GET'};
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}}/labels/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/labels/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/labels/',
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: 'GET', url: '{{baseUrl}}/labels/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/labels/');
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}}/labels/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/labels/';
const options = {method: 'GET'};
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}}/labels/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/labels/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/labels/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/labels/');
echo $response->getBody();
setUrl('{{baseUrl}}/labels/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/labels/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/labels/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/labels/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/labels/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/labels/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/labels/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/labels/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/labels/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/labels/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/labels/
http GET {{baseUrl}}/labels/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/labels/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/labels/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update
{{baseUrl}}/labels/:id/
QUERY PARAMS
id
BODY json
{
"id": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/labels/:id/");
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 \"id\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/labels/:id/" {:content-type :json
:form-params {:id ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/labels/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"name\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/labels/:id/"),
Content = new StringContent("{\n \"id\": \"\",\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}}/labels/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/labels/:id/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/labels/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"id": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/labels/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/labels/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\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 \"id\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/labels/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/labels/:id/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/labels/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/labels/:id/',
headers: {'content-type': 'application/json'},
data: {id: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/labels/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"id":"","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}}/labels/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\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 \"id\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/labels/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/labels/:id/',
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({id: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/labels/:id/',
headers: {'content-type': 'application/json'},
body: {id: '', 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('PATCH', '{{baseUrl}}/labels/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
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: 'PATCH',
url: '{{baseUrl}}/labels/:id/',
headers: {'content-type': 'application/json'},
data: {id: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/labels/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"id":"","name":""}'
};
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 = @{ @"id": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/labels/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/labels/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/labels/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'name' => ''
]),
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('PATCH', '{{baseUrl}}/labels/:id/', [
'body' => '{
"id": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/labels/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/labels/:id/');
$request->setRequestMethod('PATCH');
$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}}/labels/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/labels/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/labels/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/labels/:id/"
payload = {
"id": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/labels/:id/"
payload <- "{\n \"id\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/labels/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\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.patch('/baseUrl/labels/:id/') do |req|
req.body = "{\n \"id\": \"\",\n \"name\": \"\"\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}}/labels/:id/";
let payload = json!({
"id": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/labels/:id/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"name": ""
}'
echo '{
"id": "",
"name": ""
}' | \
http PATCH {{baseUrl}}/labels/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/labels/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/labels/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve framework (GET)
{{baseUrl}}/labels/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/labels/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/labels/:id/")
require "http/client"
url = "{{baseUrl}}/labels/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/labels/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/labels/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/labels/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/labels/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/labels/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/labels/:id/"))
.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}}/labels/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/labels/:id/")
.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}}/labels/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/labels/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/labels/:id/';
const options = {method: 'GET'};
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}}/labels/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/labels/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/labels/:id/',
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: 'GET', url: '{{baseUrl}}/labels/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/labels/:id/');
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}}/labels/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/labels/:id/';
const options = {method: 'GET'};
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}}/labels/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/labels/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/labels/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/labels/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/labels/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/labels/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/labels/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/labels/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/labels/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/labels/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/labels/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/labels/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/labels/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/labels/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/labels/:id/
http GET {{baseUrl}}/labels/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/labels/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/labels/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update label
{{baseUrl}}/labels/:id/
QUERY PARAMS
id
BODY json
{
"id": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/labels/:id/");
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 \"id\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/labels/:id/" {:content-type :json
:form-params {:id ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/labels/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"name\": \"\"\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}}/labels/:id/"),
Content = new StringContent("{\n \"id\": \"\",\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}}/labels/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/labels/:id/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/labels/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"id": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/labels/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/labels/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\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 \"id\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/labels/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/labels/:id/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/labels/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/labels/:id/',
headers: {'content-type': 'application/json'},
data: {id: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/labels/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","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}}/labels/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\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 \"id\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/labels/:id/")
.put(body)
.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/labels/:id/',
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({id: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/labels/:id/',
headers: {'content-type': 'application/json'},
body: {id: '', 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('PUT', '{{baseUrl}}/labels/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
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: 'PUT',
url: '{{baseUrl}}/labels/:id/',
headers: {'content-type': 'application/json'},
data: {id: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/labels/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","name":""}'
};
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 = @{ @"id": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/labels/:id/"]
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}}/labels/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/labels/:id/",
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' => '',
'name' => ''
]),
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('PUT', '{{baseUrl}}/labels/:id/', [
'body' => '{
"id": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/labels/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/labels/:id/');
$request->setRequestMethod('PUT');
$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}}/labels/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/labels/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/labels/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/labels/:id/"
payload = {
"id": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/labels/:id/"
payload <- "{\n \"id\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/labels/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\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.put('/baseUrl/labels/:id/') do |req|
req.body = "{\n \"id\": \"\",\n \"name\": \"\"\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}}/labels/:id/";
let payload = json!({
"id": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/labels/:id/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"name": ""
}'
echo '{
"id": "",
"name": ""
}' | \
http PUT {{baseUrl}}/labels/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/labels/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/labels/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Authenticate user
{{baseUrl}}/auth/obtain/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/auth/obtain/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/auth/obtain/")
require "http/client"
url = "{{baseUrl}}/auth/obtain/"
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}}/auth/obtain/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/auth/obtain/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/auth/obtain/"
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/auth/obtain/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/auth/obtain/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/auth/obtain/"))
.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}}/auth/obtain/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/auth/obtain/")
.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}}/auth/obtain/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/auth/obtain/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/auth/obtain/';
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}}/auth/obtain/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/auth/obtain/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/auth/obtain/',
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}}/auth/obtain/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/auth/obtain/');
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}}/auth/obtain/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/auth/obtain/';
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}}/auth/obtain/"]
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}}/auth/obtain/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/auth/obtain/",
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}}/auth/obtain/');
echo $response->getBody();
setUrl('{{baseUrl}}/auth/obtain/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/auth/obtain/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/auth/obtain/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/auth/obtain/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/auth/obtain/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/auth/obtain/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/auth/obtain/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/auth/obtain/")
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/auth/obtain/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/auth/obtain/";
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}}/auth/obtain/
http POST {{baseUrl}}/auth/obtain/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/auth/obtain/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/auth/obtain/")! 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
Enterprise token refresh
{{baseUrl}}/enterprise/auth/refresh/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/enterprise/auth/refresh/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/enterprise/auth/refresh/")
require "http/client"
url = "{{baseUrl}}/enterprise/auth/refresh/"
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}}/enterprise/auth/refresh/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/enterprise/auth/refresh/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/enterprise/auth/refresh/"
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/enterprise/auth/refresh/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/enterprise/auth/refresh/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/enterprise/auth/refresh/"))
.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}}/enterprise/auth/refresh/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/enterprise/auth/refresh/")
.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}}/enterprise/auth/refresh/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/enterprise/auth/refresh/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/enterprise/auth/refresh/';
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}}/enterprise/auth/refresh/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/enterprise/auth/refresh/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/enterprise/auth/refresh/',
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}}/enterprise/auth/refresh/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/enterprise/auth/refresh/');
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}}/enterprise/auth/refresh/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/enterprise/auth/refresh/';
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}}/enterprise/auth/refresh/"]
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}}/enterprise/auth/refresh/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/enterprise/auth/refresh/",
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}}/enterprise/auth/refresh/');
echo $response->getBody();
setUrl('{{baseUrl}}/enterprise/auth/refresh/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/enterprise/auth/refresh/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/enterprise/auth/refresh/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/enterprise/auth/refresh/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/enterprise/auth/refresh/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/enterprise/auth/refresh/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/enterprise/auth/refresh/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/enterprise/auth/refresh/")
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/enterprise/auth/refresh/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/enterprise/auth/refresh/";
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}}/enterprise/auth/refresh/
http POST {{baseUrl}}/enterprise/auth/refresh/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/enterprise/auth/refresh/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/enterprise/auth/refresh/")! 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
Enterprise token revokation
{{baseUrl}}/enterprise/auth/revoke/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/enterprise/auth/revoke/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/enterprise/auth/revoke/")
require "http/client"
url = "{{baseUrl}}/enterprise/auth/revoke/"
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}}/enterprise/auth/revoke/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/enterprise/auth/revoke/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/enterprise/auth/revoke/"
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/enterprise/auth/revoke/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/enterprise/auth/revoke/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/enterprise/auth/revoke/"))
.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}}/enterprise/auth/revoke/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/enterprise/auth/revoke/")
.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}}/enterprise/auth/revoke/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/enterprise/auth/revoke/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/enterprise/auth/revoke/';
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}}/enterprise/auth/revoke/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/enterprise/auth/revoke/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/enterprise/auth/revoke/',
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}}/enterprise/auth/revoke/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/enterprise/auth/revoke/');
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}}/enterprise/auth/revoke/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/enterprise/auth/revoke/';
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}}/enterprise/auth/revoke/"]
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}}/enterprise/auth/revoke/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/enterprise/auth/revoke/",
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}}/enterprise/auth/revoke/');
echo $response->getBody();
setUrl('{{baseUrl}}/enterprise/auth/revoke/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/enterprise/auth/revoke/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/enterprise/auth/revoke/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/enterprise/auth/revoke/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/enterprise/auth/revoke/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/enterprise/auth/revoke/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/enterprise/auth/revoke/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/enterprise/auth/revoke/")
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/enterprise/auth/revoke/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/enterprise/auth/revoke/";
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}}/enterprise/auth/revoke/
http POST {{baseUrl}}/enterprise/auth/revoke/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/enterprise/auth/revoke/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/enterprise/auth/revoke/")! 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
Enterprise token verification
{{baseUrl}}/enterprise/auth/verify/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/enterprise/auth/verify/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/enterprise/auth/verify/")
require "http/client"
url = "{{baseUrl}}/enterprise/auth/verify/"
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}}/enterprise/auth/verify/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/enterprise/auth/verify/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/enterprise/auth/verify/"
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/enterprise/auth/verify/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/enterprise/auth/verify/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/enterprise/auth/verify/"))
.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}}/enterprise/auth/verify/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/enterprise/auth/verify/")
.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}}/enterprise/auth/verify/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/enterprise/auth/verify/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/enterprise/auth/verify/';
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}}/enterprise/auth/verify/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/enterprise/auth/verify/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/enterprise/auth/verify/',
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}}/enterprise/auth/verify/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/enterprise/auth/verify/');
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}}/enterprise/auth/verify/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/enterprise/auth/verify/';
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}}/enterprise/auth/verify/"]
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}}/enterprise/auth/verify/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/enterprise/auth/verify/",
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}}/enterprise/auth/verify/');
echo $response->getBody();
setUrl('{{baseUrl}}/enterprise/auth/verify/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/enterprise/auth/verify/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/enterprise/auth/verify/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/enterprise/auth/verify/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/enterprise/auth/verify/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/enterprise/auth/verify/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/enterprise/auth/verify/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/enterprise/auth/verify/")
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/enterprise/auth/verify/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/enterprise/auth/verify/";
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}}/enterprise/auth/verify/
http POST {{baseUrl}}/enterprise/auth/verify/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/enterprise/auth/verify/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/enterprise/auth/verify/")! 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
Enterprise user authentication
{{baseUrl}}/enterprise/auth/obtain/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/enterprise/auth/obtain/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/enterprise/auth/obtain/")
require "http/client"
url = "{{baseUrl}}/enterprise/auth/obtain/"
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}}/enterprise/auth/obtain/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/enterprise/auth/obtain/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/enterprise/auth/obtain/"
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/enterprise/auth/obtain/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/enterprise/auth/obtain/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/enterprise/auth/obtain/"))
.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}}/enterprise/auth/obtain/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/enterprise/auth/obtain/")
.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}}/enterprise/auth/obtain/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/enterprise/auth/obtain/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/enterprise/auth/obtain/';
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}}/enterprise/auth/obtain/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/enterprise/auth/obtain/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/enterprise/auth/obtain/',
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}}/enterprise/auth/obtain/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/enterprise/auth/obtain/');
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}}/enterprise/auth/obtain/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/enterprise/auth/obtain/';
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}}/enterprise/auth/obtain/"]
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}}/enterprise/auth/obtain/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/enterprise/auth/obtain/",
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}}/enterprise/auth/obtain/');
echo $response->getBody();
setUrl('{{baseUrl}}/enterprise/auth/obtain/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/enterprise/auth/obtain/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/enterprise/auth/obtain/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/enterprise/auth/obtain/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/enterprise/auth/obtain/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/enterprise/auth/obtain/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/enterprise/auth/obtain/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/enterprise/auth/obtain/")
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/enterprise/auth/obtain/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/enterprise/auth/obtain/";
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}}/enterprise/auth/obtain/
http POST {{baseUrl}}/enterprise/auth/obtain/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/enterprise/auth/obtain/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/enterprise/auth/obtain/")! 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
Replace token with a new one
{{baseUrl}}/auth/refresh/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/auth/refresh/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/auth/refresh/")
require "http/client"
url = "{{baseUrl}}/auth/refresh/"
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}}/auth/refresh/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/auth/refresh/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/auth/refresh/"
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/auth/refresh/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/auth/refresh/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/auth/refresh/"))
.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}}/auth/refresh/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/auth/refresh/")
.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}}/auth/refresh/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/auth/refresh/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/auth/refresh/';
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}}/auth/refresh/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/auth/refresh/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/auth/refresh/',
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}}/auth/refresh/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/auth/refresh/');
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}}/auth/refresh/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/auth/refresh/';
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}}/auth/refresh/"]
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}}/auth/refresh/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/auth/refresh/",
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}}/auth/refresh/');
echo $response->getBody();
setUrl('{{baseUrl}}/auth/refresh/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/auth/refresh/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/auth/refresh/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/auth/refresh/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/auth/refresh/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/auth/refresh/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/auth/refresh/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/auth/refresh/")
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/auth/refresh/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/auth/refresh/";
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}}/auth/refresh/
http POST {{baseUrl}}/auth/refresh/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/auth/refresh/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/auth/refresh/")! 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
Revoke a token
{{baseUrl}}/auth/revoke/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/auth/revoke/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/auth/revoke/")
require "http/client"
url = "{{baseUrl}}/auth/revoke/"
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}}/auth/revoke/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/auth/revoke/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/auth/revoke/"
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/auth/revoke/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/auth/revoke/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/auth/revoke/"))
.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}}/auth/revoke/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/auth/revoke/")
.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}}/auth/revoke/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/auth/revoke/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/auth/revoke/';
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}}/auth/revoke/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/auth/revoke/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/auth/revoke/',
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}}/auth/revoke/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/auth/revoke/');
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}}/auth/revoke/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/auth/revoke/';
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}}/auth/revoke/"]
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}}/auth/revoke/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/auth/revoke/",
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}}/auth/revoke/');
echo $response->getBody();
setUrl('{{baseUrl}}/auth/revoke/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/auth/revoke/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/auth/revoke/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/auth/revoke/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/auth/revoke/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/auth/revoke/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/auth/revoke/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/auth/revoke/")
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/auth/revoke/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/auth/revoke/";
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}}/auth/revoke/
http POST {{baseUrl}}/auth/revoke/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/auth/revoke/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/auth/revoke/")! 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
Verify a token
{{baseUrl}}/auth/verify/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/auth/verify/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/auth/verify/")
require "http/client"
url = "{{baseUrl}}/auth/verify/"
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}}/auth/verify/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/auth/verify/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/auth/verify/"
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/auth/verify/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/auth/verify/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/auth/verify/"))
.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}}/auth/verify/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/auth/verify/")
.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}}/auth/verify/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/auth/verify/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/auth/verify/';
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}}/auth/verify/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/auth/verify/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/auth/verify/',
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}}/auth/verify/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/auth/verify/');
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}}/auth/verify/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/auth/verify/';
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}}/auth/verify/"]
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}}/auth/verify/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/auth/verify/",
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}}/auth/verify/');
echo $response->getBody();
setUrl('{{baseUrl}}/auth/verify/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/auth/verify/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/auth/verify/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/auth/verify/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/auth/verify/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/auth/verify/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/auth/verify/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/auth/verify/")
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/auth/verify/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/auth/verify/";
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}}/auth/verify/
http POST {{baseUrl}}/auth/verify/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/auth/verify/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/auth/verify/")! 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
Check validity of password reset token
{{baseUrl}}/check/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/check/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/check/")
require "http/client"
url = "{{baseUrl}}/check/"
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}}/check/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/check/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/check/"
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/check/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/check/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/check/"))
.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}}/check/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/check/")
.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}}/check/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/check/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/check/';
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}}/check/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/check/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/check/',
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}}/check/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/check/');
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}}/check/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/check/';
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}}/check/"]
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}}/check/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/check/",
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}}/check/');
echo $response->getBody();
setUrl('{{baseUrl}}/check/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/check/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/check/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/check/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/check/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/check/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/check/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/check/")
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/check/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/check/";
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}}/check/
http POST {{baseUrl}}/check/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/check/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/check/")! 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
Reset password after asking for a reset (with the token sent by email).
{{baseUrl}}/setpassword/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/setpassword/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/setpassword/")
require "http/client"
url = "{{baseUrl}}/setpassword/"
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}}/setpassword/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/setpassword/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/setpassword/"
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/setpassword/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/setpassword/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/setpassword/"))
.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}}/setpassword/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/setpassword/")
.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}}/setpassword/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/setpassword/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/setpassword/';
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}}/setpassword/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/setpassword/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/setpassword/',
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}}/setpassword/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/setpassword/');
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}}/setpassword/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/setpassword/';
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}}/setpassword/"]
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}}/setpassword/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/setpassword/",
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}}/setpassword/');
echo $response->getBody();
setUrl('{{baseUrl}}/setpassword/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/setpassword/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/setpassword/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/setpassword/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/setpassword/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/setpassword/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/setpassword/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/setpassword/")
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/setpassword/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/setpassword/";
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}}/setpassword/
http POST {{baseUrl}}/setpassword/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/setpassword/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/setpassword/")! 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
Send reset password email
{{baseUrl}}/reset/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reset/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/reset/")
require "http/client"
url = "{{baseUrl}}/reset/"
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}}/reset/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reset/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reset/"
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/reset/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/reset/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reset/"))
.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}}/reset/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/reset/")
.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}}/reset/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/reset/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reset/';
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}}/reset/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/reset/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/reset/',
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}}/reset/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/reset/');
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}}/reset/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reset/';
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}}/reset/"]
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}}/reset/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reset/",
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}}/reset/');
echo $response->getBody();
setUrl('{{baseUrl}}/reset/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/reset/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reset/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reset/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/reset/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reset/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reset/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reset/")
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/reset/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reset/";
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}}/reset/
http POST {{baseUrl}}/reset/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/reset/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reset/")! 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()
GET
Subscription plans
{{baseUrl}}/plans/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/plans/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/plans/")
require "http/client"
url = "{{baseUrl}}/plans/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/plans/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/plans/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/plans/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/plans/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/plans/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/plans/"))
.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}}/plans/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/plans/")
.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}}/plans/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/plans/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/plans/';
const options = {method: 'GET'};
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}}/plans/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/plans/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/plans/',
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: 'GET', url: '{{baseUrl}}/plans/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/plans/');
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}}/plans/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/plans/';
const options = {method: 'GET'};
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}}/plans/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/plans/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/plans/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/plans/');
echo $response->getBody();
setUrl('{{baseUrl}}/plans/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/plans/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/plans/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/plans/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/plans/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/plans/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/plans/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/plans/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/plans/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/plans/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/plans/
http GET {{baseUrl}}/plans/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/plans/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/plans/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
Cancel running scan
{{baseUrl}}/targets/:target_id/scans/:id/cancel/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/cancel/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/scans/:id/cancel/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/cancel/"
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}}/targets/:target_id/scans/:id/cancel/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/cancel/");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/cancel/"
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/targets/:target_id/scans/:id/cancel/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/scans/:id/cancel/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/cancel/"))
.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}}/targets/:target_id/scans/:id/cancel/")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/scans/:id/cancel/")
.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}}/targets/:target_id/scans/:id/cancel/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/scans/:id/cancel/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/cancel/';
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}}/targets/:target_id/scans/:id/cancel/',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/cancel/")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/cancel/',
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}}/targets/:target_id/scans/:id/cancel/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/targets/:target_id/scans/:id/cancel/');
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}}/targets/:target_id/scans/:id/cancel/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/cancel/';
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}}/targets/:target_id/scans/:id/cancel/"]
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}}/targets/:target_id/scans/:id/cancel/" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/cancel/",
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}}/targets/:target_id/scans/:id/cancel/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/cancel/');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/cancel/');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/cancel/' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/cancel/' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/targets/:target_id/scans/:id/cancel/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/cancel/"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/cancel/"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/cancel/")
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/targets/:target_id/scans/:id/cancel/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/cancel/";
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}}/targets/:target_id/scans/:id/cancel/
http POST {{baseUrl}}/targets/:target_id/scans/:id/cancel/
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/cancel/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/cancel/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"completed": "2018-01-31T16:32:17.238553Z",
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"scan_profile": "normal",
"started": "2018-01-31T16:32:17.238553Z",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Dates where scans have ocurred
{{baseUrl}}/targets/:target_id/scans/dates/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/dates/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/dates/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/dates/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/dates/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/dates/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/dates/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/dates/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/dates/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/dates/"))
.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}}/targets/:target_id/scans/dates/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/dates/")
.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}}/targets/:target_id/scans/dates/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/dates/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/dates/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/dates/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/dates/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/dates/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/dates/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/dates/');
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}}/targets/:target_id/scans/dates/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/dates/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/dates/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/dates/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/dates/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/dates/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/dates/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/dates/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/dates/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/dates/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/dates/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/dates/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/dates/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/dates/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/dates/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/dates/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/dates/
http GET {{baseUrl}}/targets/:target_id/scans/dates/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/dates/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/dates/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
"2017-06-12",
"2017-06-22"
]
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List scans for all targets
{{baseUrl}}/targets/all/scans/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/scans/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/scans/")
require "http/client"
url = "{{baseUrl}}/targets/all/scans/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/scans/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/scans/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/scans/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/scans/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/scans/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/scans/"))
.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}}/targets/all/scans/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/scans/")
.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}}/targets/all/scans/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/all/scans/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/scans/';
const options = {method: 'GET'};
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}}/targets/all/scans/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/scans/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/scans/',
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: 'GET', url: '{{baseUrl}}/targets/all/scans/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/scans/');
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}}/targets/all/scans/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/scans/';
const options = {method: 'GET'};
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}}/targets/all/scans/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/scans/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/scans/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/scans/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/scans/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/scans/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/scans/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/scans/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/scans/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/scans/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/scans/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/scans/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/scans/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/scans/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/scans/
http GET {{baseUrl}}/targets/all/scans/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/scans/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/scans/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List scans
{{baseUrl}}/targets/:target_id/scans/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/"))
.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}}/targets/:target_id/scans/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/")
.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}}/targets/:target_id/scans/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/scans/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/scans/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/');
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}}/targets/:target_id/scans/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/
http GET {{baseUrl}}/targets/:target_id/scans/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve scan
{{baseUrl}}/targets/:target_id/scans/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/"))
.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}}/targets/:target_id/scans/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/:id/")
.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}}/targets/:target_id/scans/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/:id/');
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}}/targets/:target_id/scans/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/:id/
http GET {{baseUrl}}/targets/:target_id/scans/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"completed": "2018-01-31T16:32:17.238553Z",
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"scan_profile": "normal",
"started": "2018-01-31T16:32:17.238553Z",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Scan endpoints file
{{baseUrl}}/targets/:target_id/scans/:id/endpoints/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/:id/endpoints/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/endpoints/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/:id/endpoints/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/endpoints/"))
.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}}/targets/:target_id/scans/:id/endpoints/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/:id/endpoints/")
.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}}/targets/:target_id/scans/:id/endpoints/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/endpoints/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/endpoints/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/endpoints/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/');
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}}/targets/:target_id/scans/:id/endpoints/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/endpoints/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/:id/endpoints/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/endpoints/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/endpoints/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/endpoints/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/endpoints/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/:id/endpoints/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/endpoints/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/:id/endpoints/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/:id/endpoints/
http GET {{baseUrl}}/targets/:target_id/scans/:id/endpoints/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/endpoints/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/endpoints/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Scan page
{{baseUrl}}/targets/:target_id/scans/retrieve_page/
QUERY PARAMS
date
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/retrieve_page/" {:query-params {:date ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/retrieve_page/?date= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date="))
.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}}/targets/:target_id/scans/retrieve_page/?date=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=")
.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}}/targets/:target_id/scans/retrieve_page/?date=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/retrieve_page/',
params: {date: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/retrieve_page/?date=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/retrieve_page/?date=',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/retrieve_page/',
qs: {date: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/retrieve_page/');
req.query({
date: ''
});
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}}/targets/:target_id/scans/retrieve_page/',
params: {date: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/retrieve_page/?date="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/retrieve_page/?date=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/retrieve_page/');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'date' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/retrieve_page/');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'date' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/retrieve_page/?date=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/retrieve_page/"
querystring = {"date":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/retrieve_page/"
queryString <- list(date = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/retrieve_page/') do |req|
req.params['date'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/retrieve_page/";
let querystring = [
("date", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date='
http GET '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/retrieve_page/?date=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Scan report PDF, using the OWASP report type
{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/:id/report/owasp/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/"))
.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}}/targets/:target_id/scans/:id/report/owasp/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/")
.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}}/targets/:target_id/scans/:id/report/owasp/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/owasp/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/report/owasp/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/');
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}}/targets/:target_id/scans/:id/report/owasp/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/owasp/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/:id/report/owasp/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/:id/report/owasp/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/:id/report/owasp/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/:id/report/owasp/
http GET {{baseUrl}}/targets/:target_id/scans/:id/report/owasp/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/report/owasp/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/report/owasp/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Scan report PDF, using the PCI report type
{{baseUrl}}/targets/:target_id/scans/:id/report/pci/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/:id/report/pci/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/report/pci/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/:id/report/pci/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/report/pci/"))
.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}}/targets/:target_id/scans/:id/report/pci/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/:id/report/pci/")
.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}}/targets/:target_id/scans/:id/report/pci/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/pci/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/report/pci/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/report/pci/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/');
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}}/targets/:target_id/scans/:id/report/pci/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/pci/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/:id/report/pci/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/report/pci/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/pci/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/pci/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/pci/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/:id/report/pci/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/report/pci/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/:id/report/pci/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/:id/report/pci/
http GET {{baseUrl}}/targets/:target_id/scans/:id/report/pci/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/report/pci/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/report/pci/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Scan report PDF, using the default report type
{{baseUrl}}/targets/:target_id/scans/:id/report/default/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/report/default/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/:id/report/default/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/default/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/:id/report/default/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/report/default/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/report/default/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/:id/report/default/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/:id/report/default/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/report/default/"))
.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}}/targets/:target_id/scans/:id/report/default/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/:id/report/default/")
.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}}/targets/:target_id/scans/:id/report/default/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/default/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/default/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/default/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/report/default/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/report/default/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/default/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/default/');
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}}/targets/:target_id/scans/:id/report/default/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/default/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/default/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/:id/report/default/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/report/default/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/default/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/default/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/default/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/default/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/default/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/:id/report/default/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/default/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/report/default/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/report/default/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/:id/report/default/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/report/default/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/:id/report/default/
http GET {{baseUrl}}/targets/:target_id/scans/:id/report/default/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/report/default/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/report/default/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Scan report PDF, using the report type specified for the target
{{baseUrl}}/targets/:target_id/scans/:id/report/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scans/:id/report/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scans/:id/report/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scans/:id/report/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scans/:id/report/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scans/:id/report/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scans/:id/report/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scans/:id/report/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scans/:id/report/"))
.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}}/targets/:target_id/scans/:id/report/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scans/:id/report/")
.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}}/targets/:target_id/scans/:id/report/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scans/:id/report/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scans/:id/report/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scans/:id/report/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/');
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}}/targets/:target_id/scans/:id/report/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scans/:id/report/';
const options = {method: 'GET'};
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}}/targets/:target_id/scans/:id/report/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scans/:id/report/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scans/:id/report/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scans/:id/report/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scans/:id/report/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scans/:id/report/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scans/:id/report/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scans/:id/report/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scans/:id/report/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scans/:id/report/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scans/:id/report/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scans/:id/report/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scans/:id/report/
http GET {{baseUrl}}/targets/:target_id/scans/:id/report/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scans/:id/report/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scans/:id/report/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Start a scan on the target
{{baseUrl}}/targets/:target_id/scan_now/
QUERY PARAMS
target_id
BODY json
{
"scan_profile": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scan_now/");
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 \"scan_profile\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/scan_now/" {:content-type :json
:form-params {:scan_profile ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scan_now/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"scan_profile\": \"\"\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}}/targets/:target_id/scan_now/"),
Content = new StringContent("{\n \"scan_profile\": \"\"\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}}/targets/:target_id/scan_now/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"scan_profile\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scan_now/"
payload := strings.NewReader("{\n \"scan_profile\": \"\"\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/targets/:target_id/scan_now/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"scan_profile": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/scan_now/")
.setHeader("content-type", "application/json")
.setBody("{\n \"scan_profile\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scan_now/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"scan_profile\": \"\"\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 \"scan_profile\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scan_now/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/scan_now/")
.header("content-type", "application/json")
.body("{\n \"scan_profile\": \"\"\n}")
.asString();
const data = JSON.stringify({
scan_profile: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/scan_now/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/scan_now/',
headers: {'content-type': 'application/json'},
data: {scan_profile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scan_now/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"scan_profile":""}'
};
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}}/targets/:target_id/scan_now/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "scan_profile": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"scan_profile\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scan_now/")
.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/targets/:target_id/scan_now/',
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({scan_profile: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/scan_now/',
headers: {'content-type': 'application/json'},
body: {scan_profile: ''},
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}}/targets/:target_id/scan_now/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
scan_profile: ''
});
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}}/targets/:target_id/scan_now/',
headers: {'content-type': 'application/json'},
data: {scan_profile: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scan_now/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"scan_profile":""}'
};
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 = @{ @"scan_profile": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/scan_now/"]
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}}/targets/:target_id/scan_now/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"scan_profile\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scan_now/",
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([
'scan_profile' => ''
]),
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}}/targets/:target_id/scan_now/', [
'body' => '{
"scan_profile": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scan_now/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'scan_profile' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'scan_profile' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/scan_now/');
$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}}/targets/:target_id/scan_now/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"scan_profile": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scan_now/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"scan_profile": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"scan_profile\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/scan_now/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scan_now/"
payload = { "scan_profile": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scan_now/"
payload <- "{\n \"scan_profile\": \"\"\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}}/targets/:target_id/scan_now/")
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 \"scan_profile\": \"\"\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/targets/:target_id/scan_now/') do |req|
req.body = "{\n \"scan_profile\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scan_now/";
let payload = json!({"scan_profile": ""});
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}}/targets/:target_id/scan_now/ \
--header 'content-type: application/json' \
--data '{
"scan_profile": ""
}'
echo '{
"scan_profile": ""
}' | \
http POST {{baseUrl}}/targets/:target_id/scan_now/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "scan_profile": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/scan_now/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["scan_profile": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scan_now/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"completed": "2018-01-31T16:32:17.238553Z",
"created": "2018-01-31T16:32:17.238553Z",
"created_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"scan_profile": "normal",
"started": "2018-01-31T16:32:17.238553Z",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create new scheduled scan
{{baseUrl}}/targets/:target_id/scheduledscans/
QUERY PARAMS
target_id
BODY json
{
"date_time": "",
"recurrence": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/");
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 \"date_time\": \"\",\n \"recurrence\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/scheduledscans/" {:content-type :json
:form-params {:date_time ""
:recurrence ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/"),
Content = new StringContent("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/"
payload := strings.NewReader("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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/targets/:target_id/scheduledscans/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"date_time": "",
"recurrence": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/scheduledscans/")
.setHeader("content-type", "application/json")
.setBody("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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 \"date_time\": \"\",\n \"recurrence\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/scheduledscans/")
.header("content-type", "application/json")
.body("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
.asString();
const data = JSON.stringify({
date_time: '',
recurrence: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/scheduledscans/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/',
headers: {'content-type': 'application/json'},
data: {date_time: '', recurrence: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"date_time":"","recurrence":""}'
};
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}}/targets/:target_id/scheduledscans/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "date_time": "",\n "recurrence": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/")
.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/targets/:target_id/scheduledscans/',
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({date_time: '', recurrence: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/',
headers: {'content-type': 'application/json'},
body: {date_time: '', recurrence: ''},
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}}/targets/:target_id/scheduledscans/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
date_time: '',
recurrence: ''
});
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}}/targets/:target_id/scheduledscans/',
headers: {'content-type': 'application/json'},
data: {date_time: '', recurrence: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"date_time":"","recurrence":""}'
};
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 = @{ @"date_time": @"",
@"recurrence": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/scheduledscans/"]
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}}/targets/:target_id/scheduledscans/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/",
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([
'date_time' => '',
'recurrence' => ''
]),
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}}/targets/:target_id/scheduledscans/', [
'body' => '{
"date_time": "",
"recurrence": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'date_time' => '',
'recurrence' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'date_time' => '',
'recurrence' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/');
$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}}/targets/:target_id/scheduledscans/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date_time": "",
"recurrence": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date_time": "",
"recurrence": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/scheduledscans/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/"
payload = {
"date_time": "",
"recurrence": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/"
payload <- "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/")
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 \"date_time\": \"\",\n \"recurrence\": \"\"\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/targets/:target_id/scheduledscans/') do |req|
req.body = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scheduledscans/";
let payload = json!({
"date_time": "",
"recurrence": ""
});
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}}/targets/:target_id/scheduledscans/ \
--header 'content-type: application/json' \
--data '{
"date_time": "",
"recurrence": ""
}'
echo '{
"date_time": "",
"recurrence": ""
}' | \
http POST {{baseUrl}}/targets/:target_id/scheduledscans/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "date_time": "",\n "recurrence": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"date_time": "",
"recurrence": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "QJxMvgPebu0e",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
DELETE
Delete
{{baseUrl}}/targets/:target_id/scheduledscans/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scheduledscans/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/targets/:target_id/scheduledscans/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"))
.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}}/targets/:target_id/scheduledscans/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.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}}/targets/:target_id/scheduledscans/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/scheduledscans/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scheduledscans/:id/',
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: 'DELETE',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
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}}/targets/:target_id/scheduledscans/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {method: 'DELETE'};
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}}/targets/:target_id/scheduledscans/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/targets/:target_id/scheduledscans/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/targets/:target_id/scheduledscans/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/targets/:target_id/scheduledscans/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/targets/:target_id/scheduledscans/:id/
http DELETE {{baseUrl}}/targets/:target_id/scheduledscans/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List scheduled scans expanding recurrence
{{baseUrl}}/targets/:target_id/scheduledscans/expanded/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scheduledscans/expanded/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scheduledscans/expanded/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scheduledscans/expanded/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/expanded/"))
.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}}/targets/:target_id/scheduledscans/expanded/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scheduledscans/expanded/")
.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}}/targets/:target_id/scheduledscans/expanded/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/';
const options = {method: 'GET'};
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}}/targets/:target_id/scheduledscans/expanded/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/expanded/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scheduledscans/expanded/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/');
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}}/targets/:target_id/scheduledscans/expanded/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/';
const options = {method: 'GET'};
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}}/targets/:target_id/scheduledscans/expanded/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scheduledscans/expanded/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/expanded/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/expanded/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/expanded/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/expanded/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scheduledscans/expanded/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scheduledscans/expanded/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scheduledscans/expanded/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scheduledscans/expanded/
http GET {{baseUrl}}/targets/:target_id/scheduledscans/expanded/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/expanded/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/expanded/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
List scheduled scans for all targets expanding recurrence
{{baseUrl}}/targets/all/scheduledscans/expanded/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/scheduledscans/expanded/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/scheduledscans/expanded/")
require "http/client"
url = "{{baseUrl}}/targets/all/scheduledscans/expanded/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/scheduledscans/expanded/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/scheduledscans/expanded/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/scheduledscans/expanded/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/scheduledscans/expanded/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/scheduledscans/expanded/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/scheduledscans/expanded/"))
.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}}/targets/all/scheduledscans/expanded/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/scheduledscans/expanded/")
.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}}/targets/all/scheduledscans/expanded/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/all/scheduledscans/expanded/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/scheduledscans/expanded/';
const options = {method: 'GET'};
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}}/targets/all/scheduledscans/expanded/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/scheduledscans/expanded/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/scheduledscans/expanded/',
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: 'GET',
url: '{{baseUrl}}/targets/all/scheduledscans/expanded/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/scheduledscans/expanded/');
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}}/targets/all/scheduledscans/expanded/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/scheduledscans/expanded/';
const options = {method: 'GET'};
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}}/targets/all/scheduledscans/expanded/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/scheduledscans/expanded/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/scheduledscans/expanded/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/scheduledscans/expanded/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/scheduledscans/expanded/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/scheduledscans/expanded/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/scheduledscans/expanded/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/scheduledscans/expanded/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/scheduledscans/expanded/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/scheduledscans/expanded/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/scheduledscans/expanded/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/scheduledscans/expanded/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/scheduledscans/expanded/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/scheduledscans/expanded/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/scheduledscans/expanded/
http GET {{baseUrl}}/targets/all/scheduledscans/expanded/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/scheduledscans/expanded/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/scheduledscans/expanded/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
List scheduled scans
{{baseUrl}}/targets/:target_id/scheduledscans/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scheduledscans/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scheduledscans/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scheduledscans/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scheduledscans/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scheduledscans/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/"))
.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}}/targets/:target_id/scheduledscans/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scheduledscans/")
.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}}/targets/:target_id/scheduledscans/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/';
const options = {method: 'GET'};
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}}/targets/:target_id/scheduledscans/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scheduledscans/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scheduledscans/');
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}}/targets/:target_id/scheduledscans/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/';
const options = {method: 'GET'};
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}}/targets/:target_id/scheduledscans/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scheduledscans/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scheduledscans/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scheduledscans/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scheduledscans/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scheduledscans/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scheduledscans/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scheduledscans/
http GET {{baseUrl}}/targets/:target_id/scheduledscans/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update (PATCH)
{{baseUrl}}/targets/:target_id/scheduledscans/:id/
QUERY PARAMS
target_id
id
BODY json
{
"date_time": "",
"recurrence": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/:id/");
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 \"date_time\": \"\",\n \"recurrence\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/scheduledscans/:id/" {:content-type :json
:form-params {:date_time ""
:recurrence ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"),
Content = new StringContent("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
payload := strings.NewReader("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/scheduledscans/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"date_time": "",
"recurrence": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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 \"date_time\": \"\",\n \"recurrence\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.header("content-type", "application/json")
.body("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
.asString();
const data = JSON.stringify({
date_time: '',
recurrence: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/',
headers: {'content-type': 'application/json'},
data: {date_time: '', recurrence: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"date_time":"","recurrence":""}'
};
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}}/targets/:target_id/scheduledscans/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "date_time": "",\n "recurrence": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scheduledscans/:id/',
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({date_time: '', recurrence: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/',
headers: {'content-type': 'application/json'},
body: {date_time: '', recurrence: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
date_time: '',
recurrence: ''
});
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}}/targets/:target_id/scheduledscans/:id/',
headers: {'content-type': 'application/json'},
data: {date_time: '', recurrence: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"date_time":"","recurrence":""}'
};
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 = @{ @"date_time": @"",
@"recurrence": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/scheduledscans/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/scheduledscans/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'date_time' => '',
'recurrence' => ''
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/', [
'body' => '{
"date_time": "",
"recurrence": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'date_time' => '',
'recurrence' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'date_time' => '',
'recurrence' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/scheduledscans/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"date_time": "",
"recurrence": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"date_time": "",
"recurrence": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/scheduledscans/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
payload = {
"date_time": "",
"recurrence": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
payload <- "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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.patch('/baseUrl/targets/:target_id/scheduledscans/:id/') do |req|
req.body = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/:id/";
let payload = json!({
"date_time": "",
"recurrence": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/scheduledscans/:id/ \
--header 'content-type: application/json' \
--data '{
"date_time": "",
"recurrence": ""
}'
echo '{
"date_time": "",
"recurrence": ""
}' | \
http PATCH {{baseUrl}}/targets/:target_id/scheduledscans/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "date_time": "",\n "recurrence": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"date_time": "",
"recurrence": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "QJxMvgPebu0e",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve a scheduled scan
{{baseUrl}}/targets/:target_id/scheduledscans/:id/
QUERY PARAMS
target_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/scheduledscans/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/scheduledscans/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"))
.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}}/targets/:target_id/scheduledscans/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.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}}/targets/:target_id/scheduledscans/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/scheduledscans/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/scheduledscans/:id/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
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}}/targets/:target_id/scheduledscans/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {method: 'GET'};
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}}/targets/:target_id/scheduledscans/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/scheduledscans/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/scheduledscans/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/scheduledscans/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/scheduledscans/:id/
http GET {{baseUrl}}/targets/:target_id/scheduledscans/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "QJxMvgPebu0e",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update a scheduled scan
{{baseUrl}}/targets/:target_id/scheduledscans/:id/
QUERY PARAMS
target_id
id
BODY json
{
"date_time": "",
"recurrence": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/scheduledscans/:id/");
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 \"date_time\": \"\",\n \"recurrence\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/scheduledscans/:id/" {:content-type :json
:form-params {:date_time ""
:recurrence ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/:id/"),
Content = new StringContent("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
payload := strings.NewReader("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/scheduledscans/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"date_time": "",
"recurrence": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/scheduledscans/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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 \"date_time\": \"\",\n \"recurrence\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.header("content-type", "application/json")
.body("{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
.asString();
const data = JSON.stringify({
date_time: '',
recurrence: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/',
headers: {'content-type': 'application/json'},
data: {date_time: '', recurrence: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"date_time":"","recurrence":""}'
};
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}}/targets/:target_id/scheduledscans/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "date_time": "",\n "recurrence": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
.put(body)
.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/targets/:target_id/scheduledscans/:id/',
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({date_time: '', recurrence: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/scheduledscans/:id/',
headers: {'content-type': 'application/json'},
body: {date_time: '', recurrence: ''},
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}}/targets/:target_id/scheduledscans/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
date_time: '',
recurrence: ''
});
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}}/targets/:target_id/scheduledscans/:id/',
headers: {'content-type': 'application/json'},
data: {date_time: '', recurrence: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/scheduledscans/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"date_time":"","recurrence":""}'
};
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 = @{ @"date_time": @"",
@"recurrence": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/scheduledscans/:id/"]
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}}/targets/:target_id/scheduledscans/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/scheduledscans/:id/",
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([
'date_time' => '',
'recurrence' => ''
]),
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('PUT', '{{baseUrl}}/targets/:target_id/scheduledscans/:id/', [
'body' => '{
"date_time": "",
"recurrence": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'date_time' => '',
'recurrence' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'date_time' => '',
'recurrence' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/scheduledscans/:id/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/scheduledscans/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"date_time": "",
"recurrence": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/scheduledscans/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"date_time": "",
"recurrence": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/scheduledscans/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
payload = {
"date_time": "",
"recurrence": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/scheduledscans/:id/"
payload <- "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/scheduledscans/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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/targets/:target_id/scheduledscans/:id/') do |req|
req.body = "{\n \"date_time\": \"\",\n \"recurrence\": \"\"\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}}/targets/:target_id/scheduledscans/:id/";
let payload = json!({
"date_time": "",
"recurrence": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/scheduledscans/:id/ \
--header 'content-type: application/json' \
--data '{
"date_time": "",
"recurrence": ""
}'
echo '{
"date_time": "",
"recurrence": ""
}' | \
http PUT {{baseUrl}}/targets/:target_id/scheduledscans/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "date_time": "",\n "recurrence": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/scheduledscans/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"date_time": "",
"recurrence": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/scheduledscans/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "QJxMvgPebu0e",
"target": {
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update target's site
{{baseUrl}}/targets/:target_id/site/
QUERY PARAMS
target_id
BODY json
{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/site/");
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 \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/site/" {:content-type :json
:form-params {:basic_auth {:password ""
:username ""}
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:form_login [{:name ""
:value ""}]
:form_login_check_pattern ""
:form_login_url ""
:has_basic_auth false
:has_form_login false
:headers [{:name ""
:value ""}]
:host ""
:id ""
:name ""
:stack []
:url ""
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false
:whitelist []}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/site/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/site/"),
Content = new StringContent("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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}}/targets/:target_id/site/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/site/"
payload := strings.NewReader("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/site/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 708
{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/site/")
.setHeader("content-type", "application/json")
.setBody("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/site/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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 \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/site/")
.header("content-type", "application/json")
.body("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
.asString();
const data = JSON.stringify({
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/site/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/site/',
headers: {'content-type': 'application/json'},
data: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/site/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{"name":"","value":""}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]}'
};
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}}/targets/:target_id/site/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/site/',
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({
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/site/',
headers: {'content-type': 'application/json'},
body: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/site/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
});
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}}/targets/:target_id/site/',
headers: {'content-type': 'application/json'},
data: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/site/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{"name":"","value":""}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]}'
};
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 = @{ @"basic_auth": @{ @"password": @"", @"username": @"" },
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"cookies": @[ @{ @"name": @"", @"value": @"" } ],
@"desc": @"",
@"form_login": @[ @{ @"name": @"", @"value": @"" } ],
@"form_login_check_pattern": @"",
@"form_login_url": @"",
@"has_basic_auth": @NO,
@"has_form_login": @NO,
@"headers": @[ @{ @"name": @"", @"value": @"" } ],
@"host": @"",
@"id": @"",
@"name": @"",
@"stack": @[ ],
@"url": @"",
@"verification_date": @"",
@"verification_last_error": @"",
@"verification_method": @"",
@"verification_token": @"",
@"verified": @NO,
@"whitelist": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/site/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/site/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/site/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/site/', [
'body' => '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/site/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/site/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/site/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/site/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/site/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/site/"
payload = {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": False,
"has_form_login": False,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False,
"whitelist": []
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/site/"
payload <- "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/site/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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.patch('/baseUrl/targets/:target_id/site/') do |req|
req.body = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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}}/targets/:target_id/site/";
let payload = json!({
"basic_auth": json!({
"password": "",
"username": ""
}),
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"form_login": (
json!({
"name": "",
"value": ""
})
),
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"name": "",
"stack": (),
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/site/ \
--header 'content-type: application/json' \
--data '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}'
echo '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}' | \
http PATCH {{baseUrl}}/targets/:target_id/site/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/site/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"basic_auth": [
"password": "",
"username": ""
],
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"form_login": [
[
"name": "",
"value": ""
]
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/site/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"basic_auth": {
"password": "dolphins",
"username": "probely"
},
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a",
"whitelist": [
"/private/path/"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve target's site
{{baseUrl}}/targets/:target_id/site/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/site/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/site/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/site/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/site/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/site/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/site/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/site/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/site/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/site/"))
.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}}/targets/:target_id/site/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/site/")
.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}}/targets/:target_id/site/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:target_id/site/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/site/';
const options = {method: 'GET'};
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}}/targets/:target_id/site/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/site/',
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: 'GET', url: '{{baseUrl}}/targets/:target_id/site/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/site/');
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}}/targets/:target_id/site/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/site/';
const options = {method: 'GET'};
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}}/targets/:target_id/site/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/site/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/site/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/site/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/site/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/site/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/site/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/site/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/site/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/site/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/site/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/site/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/site/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/site/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/site/
http GET {{baseUrl}}/targets/:target_id/site/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/site/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/site/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"basic_auth": {
"password": "dolphins",
"username": "probely"
},
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a",
"whitelist": [
"/private/path/"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update target's site
{{baseUrl}}/targets/:target_id/site/
QUERY PARAMS
target_id
BODY json
{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/site/");
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 \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/site/" {:content-type :json
:form-params {:basic_auth {:password ""
:username ""}
:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:form_login [{:name ""
:value ""}]
:form_login_check_pattern ""
:form_login_url ""
:has_basic_auth false
:has_form_login false
:headers [{:name ""
:value ""}]
:host ""
:id ""
:name ""
:stack []
:url ""
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false
:whitelist []}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/site/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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}}/targets/:target_id/site/"),
Content = new StringContent("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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}}/targets/:target_id/site/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/site/"
payload := strings.NewReader("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/site/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 708
{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/site/")
.setHeader("content-type", "application/json")
.setBody("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/site/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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 \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/site/")
.header("content-type", "application/json")
.body("{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
.asString();
const data = JSON.stringify({
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/site/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/site/',
headers: {'content-type': 'application/json'},
data: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/site/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{"name":"","value":""}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]}'
};
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}}/targets/:target_id/site/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/")
.put(body)
.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/targets/:target_id/site/',
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({
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/site/',
headers: {'content-type': 'application/json'},
body: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
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}}/targets/:target_id/site/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
});
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}}/targets/:target_id/site/',
headers: {'content-type': 'application/json'},
data: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{name: '', value: ''}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/site/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{"name":"","value":""}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]}'
};
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 = @{ @"basic_auth": @{ @"password": @"", @"username": @"" },
@"changed": @"",
@"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" },
@"cookies": @[ @{ @"name": @"", @"value": @"" } ],
@"desc": @"",
@"form_login": @[ @{ @"name": @"", @"value": @"" } ],
@"form_login_check_pattern": @"",
@"form_login_url": @"",
@"has_basic_auth": @NO,
@"has_form_login": @NO,
@"headers": @[ @{ @"name": @"", @"value": @"" } ],
@"host": @"",
@"id": @"",
@"name": @"",
@"stack": @[ ],
@"url": @"",
@"verification_date": @"",
@"verification_last_error": @"",
@"verification_method": @"",
@"verification_token": @"",
@"verified": @NO,
@"whitelist": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/site/"]
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}}/targets/:target_id/site/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/site/",
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([
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
]),
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('PUT', '{{baseUrl}}/targets/:target_id/site/', [
'body' => '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/site/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/site/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/site/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/site/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/site/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/site/"
payload = {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": False,
"has_form_login": False,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False,
"whitelist": []
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/site/"
payload <- "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/site/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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/targets/:target_id/site/') do |req|
req.body = "{\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\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}}/targets/:target_id/site/";
let payload = json!({
"basic_auth": json!({
"password": "",
"username": ""
}),
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"form_login": (
json!({
"name": "",
"value": ""
})
),
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"name": "",
"stack": (),
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": ()
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/site/ \
--header 'content-type: application/json' \
--data '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}'
echo '{
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
}' | \
http PUT {{baseUrl}}/targets/:target_id/site/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/site/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"basic_auth": [
"password": "",
"username": ""
],
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"form_login": [
[
"name": "",
"value": ""
]
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/site/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"basic_auth": {
"password": "dolphins",
"username": "probely"
},
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"stack": [
"nginx"
],
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a",
"whitelist": [
"/private/path/"
]
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Verify site ownership
{{baseUrl}}/targets/:target_id/site/verify/
QUERY PARAMS
target_id
BODY json
{
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/site/verify/");
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 \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/:target_id/site/verify/" {:content-type :json
:form-params {:type ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/site/verify/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"type\": \"\"\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}}/targets/:target_id/site/verify/"),
Content = new StringContent("{\n \"type\": \"\"\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}}/targets/:target_id/site/verify/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/site/verify/"
payload := strings.NewReader("{\n \"type\": \"\"\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/targets/:target_id/site/verify/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/:target_id/site/verify/")
.setHeader("content-type", "application/json")
.setBody("{\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/site/verify/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"type\": \"\"\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 \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/verify/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/:target_id/site/verify/")
.header("content-type", "application/json")
.body("{\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/:target_id/site/verify/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/site/verify/',
headers: {'content-type': 'application/json'},
data: {type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/site/verify/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"type":""}'
};
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}}/targets/:target_id/site/verify/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/site/verify/")
.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/targets/:target_id/site/verify/',
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({type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/:target_id/site/verify/',
headers: {'content-type': 'application/json'},
body: {type: ''},
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}}/targets/:target_id/site/verify/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
type: ''
});
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}}/targets/:target_id/site/verify/',
headers: {'content-type': 'application/json'},
data: {type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/site/verify/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"type":""}'
};
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 = @{ @"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/site/verify/"]
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}}/targets/:target_id/site/verify/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/site/verify/",
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([
'type' => ''
]),
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}}/targets/:target_id/site/verify/', [
'body' => '{
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/site/verify/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/site/verify/');
$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}}/targets/:target_id/site/verify/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/site/verify/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/:target_id/site/verify/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/site/verify/"
payload = { "type": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/site/verify/"
payload <- "{\n \"type\": \"\"\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}}/targets/:target_id/site/verify/")
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 \"type\": \"\"\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/targets/:target_id/site/verify/') do |req|
req.body = "{\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/site/verify/";
let payload = json!({"type": ""});
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}}/targets/:target_id/site/verify/ \
--header 'content-type: application/json' \
--data '{
"type": ""
}'
echo '{
"type": ""
}' | \
http POST {{baseUrl}}/targets/:target_id/site/verify/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/site/verify/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["type": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/site/verify/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve slack integration data
{{baseUrl}}/targets/:target_id/integrations/slack/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/slack/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/integrations/slack/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/slack/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/slack/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/integrations/slack/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/slack/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/integrations/slack/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/integrations/slack/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/slack/"))
.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}}/targets/:target_id/integrations/slack/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/integrations/slack/")
.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}}/targets/:target_id/integrations/slack/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/slack/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/slack/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/slack/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/slack/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/slack/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/integrations/slack/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/integrations/slack/');
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}}/targets/:target_id/integrations/slack/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/slack/';
const options = {method: 'GET'};
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}}/targets/:target_id/integrations/slack/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/integrations/slack/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/slack/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/integrations/slack/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/slack/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/slack/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/integrations/slack/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/slack/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/integrations/slack/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/slack/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/slack/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/slack/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/integrations/slack/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/integrations/slack/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/integrations/slack/
http GET {{baseUrl}}/targets/:target_id/integrations/slack/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/slack/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/slack/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update slack integration data (PUT)
{{baseUrl}}/targets/:target_id/integrations/slack/
QUERY PARAMS
target_id
BODY json
{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/slack/");
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 \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:target_id/integrations/slack/" {:content-type :json
:form-params {:notify_finding_fixed false
:notify_high_findings false
:notify_low_findings false
:notify_medium_findings false
:notify_scan_completed false
:notify_scan_started false
:webhook_url ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/slack/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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}}/targets/:target_id/integrations/slack/"),
Content = new StringContent("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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}}/targets/:target_id/integrations/slack/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/slack/"
payload := strings.NewReader("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:target_id/integrations/slack/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 222
{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:target_id/integrations/slack/")
.setHeader("content-type", "application/json")
.setBody("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/slack/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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 \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/slack/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:target_id/integrations/slack/")
.header("content-type", "application/json")
.body("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
.asString();
const data = JSON.stringify({
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:target_id/integrations/slack/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/integrations/slack/',
headers: {'content-type': 'application/json'},
data: {
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/slack/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"notify_finding_fixed":false,"notify_high_findings":false,"notify_low_findings":false,"notify_medium_findings":false,"notify_scan_completed":false,"notify_scan_started":false,"webhook_url":""}'
};
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}}/targets/:target_id/integrations/slack/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "notify_finding_fixed": false,\n "notify_high_findings": false,\n "notify_low_findings": false,\n "notify_medium_findings": false,\n "notify_scan_completed": false,\n "notify_scan_started": false,\n "webhook_url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/slack/")
.put(body)
.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/targets/:target_id/integrations/slack/',
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({
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:target_id/integrations/slack/',
headers: {'content-type': 'application/json'},
body: {
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
},
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}}/targets/:target_id/integrations/slack/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
});
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}}/targets/:target_id/integrations/slack/',
headers: {'content-type': 'application/json'},
data: {
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/slack/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"notify_finding_fixed":false,"notify_high_findings":false,"notify_low_findings":false,"notify_medium_findings":false,"notify_scan_completed":false,"notify_scan_started":false,"webhook_url":""}'
};
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 = @{ @"notify_finding_fixed": @NO,
@"notify_high_findings": @NO,
@"notify_low_findings": @NO,
@"notify_medium_findings": @NO,
@"notify_scan_completed": @NO,
@"notify_scan_started": @NO,
@"webhook_url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/integrations/slack/"]
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}}/targets/:target_id/integrations/slack/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/slack/",
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([
'notify_finding_fixed' => null,
'notify_high_findings' => null,
'notify_low_findings' => null,
'notify_medium_findings' => null,
'notify_scan_completed' => null,
'notify_scan_started' => null,
'webhook_url' => ''
]),
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('PUT', '{{baseUrl}}/targets/:target_id/integrations/slack/', [
'body' => '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/slack/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notify_finding_fixed' => null,
'notify_high_findings' => null,
'notify_low_findings' => null,
'notify_medium_findings' => null,
'notify_scan_completed' => null,
'notify_scan_started' => null,
'webhook_url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notify_finding_fixed' => null,
'notify_high_findings' => null,
'notify_low_findings' => null,
'notify_medium_findings' => null,
'notify_scan_completed' => null,
'notify_scan_started' => null,
'webhook_url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/slack/');
$request->setRequestMethod('PUT');
$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}}/targets/:target_id/integrations/slack/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/slack/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:target_id/integrations/slack/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/slack/"
payload = {
"notify_finding_fixed": False,
"notify_high_findings": False,
"notify_low_findings": False,
"notify_medium_findings": False,
"notify_scan_completed": False,
"notify_scan_started": False,
"webhook_url": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/slack/"
payload <- "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/slack/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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/targets/:target_id/integrations/slack/') do |req|
req.body = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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}}/targets/:target_id/integrations/slack/";
let payload = json!({
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:target_id/integrations/slack/ \
--header 'content-type: application/json' \
--data '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}'
echo '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}' | \
http PUT {{baseUrl}}/targets/:target_id/integrations/slack/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "notify_finding_fixed": false,\n "notify_high_findings": false,\n "notify_low_findings": false,\n "notify_medium_findings": false,\n "notify_scan_completed": false,\n "notify_scan_started": false,\n "webhook_url": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/slack/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/slack/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Update slack integration data
{{baseUrl}}/targets/:target_id/integrations/slack/
QUERY PARAMS
target_id
BODY json
{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/integrations/slack/");
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 \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:target_id/integrations/slack/" {:content-type :json
:form-params {:notify_finding_fixed false
:notify_high_findings false
:notify_low_findings false
:notify_medium_findings false
:notify_scan_completed false
:notify_scan_started false
:webhook_url ""}})
require "http/client"
url = "{{baseUrl}}/targets/:target_id/integrations/slack/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/integrations/slack/"),
Content = new StringContent("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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}}/targets/:target_id/integrations/slack/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/integrations/slack/"
payload := strings.NewReader("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:target_id/integrations/slack/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 222
{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:target_id/integrations/slack/")
.setHeader("content-type", "application/json")
.setBody("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/integrations/slack/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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 \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/slack/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:target_id/integrations/slack/")
.header("content-type", "application/json")
.body("{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
.asString();
const data = JSON.stringify({
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:target_id/integrations/slack/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/integrations/slack/',
headers: {'content-type': 'application/json'},
data: {
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/integrations/slack/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"notify_finding_fixed":false,"notify_high_findings":false,"notify_low_findings":false,"notify_medium_findings":false,"notify_scan_completed":false,"notify_scan_started":false,"webhook_url":""}'
};
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}}/targets/:target_id/integrations/slack/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "notify_finding_fixed": false,\n "notify_high_findings": false,\n "notify_low_findings": false,\n "notify_medium_findings": false,\n "notify_scan_completed": false,\n "notify_scan_started": false,\n "webhook_url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/integrations/slack/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/integrations/slack/',
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({
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:target_id/integrations/slack/',
headers: {'content-type': 'application/json'},
body: {
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:target_id/integrations/slack/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
});
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}}/targets/:target_id/integrations/slack/',
headers: {'content-type': 'application/json'},
data: {
notify_finding_fixed: false,
notify_high_findings: false,
notify_low_findings: false,
notify_medium_findings: false,
notify_scan_completed: false,
notify_scan_started: false,
webhook_url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/integrations/slack/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"notify_finding_fixed":false,"notify_high_findings":false,"notify_low_findings":false,"notify_medium_findings":false,"notify_scan_completed":false,"notify_scan_started":false,"webhook_url":""}'
};
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 = @{ @"notify_finding_fixed": @NO,
@"notify_high_findings": @NO,
@"notify_low_findings": @NO,
@"notify_medium_findings": @NO,
@"notify_scan_completed": @NO,
@"notify_scan_started": @NO,
@"webhook_url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:target_id/integrations/slack/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:target_id/integrations/slack/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/integrations/slack/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'notify_finding_fixed' => null,
'notify_high_findings' => null,
'notify_low_findings' => null,
'notify_medium_findings' => null,
'notify_scan_completed' => null,
'notify_scan_started' => null,
'webhook_url' => ''
]),
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('PATCH', '{{baseUrl}}/targets/:target_id/integrations/slack/', [
'body' => '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/integrations/slack/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'notify_finding_fixed' => null,
'notify_high_findings' => null,
'notify_low_findings' => null,
'notify_medium_findings' => null,
'notify_scan_completed' => null,
'notify_scan_started' => null,
'webhook_url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'notify_finding_fixed' => null,
'notify_high_findings' => null,
'notify_low_findings' => null,
'notify_medium_findings' => null,
'notify_scan_completed' => null,
'notify_scan_started' => null,
'webhook_url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:target_id/integrations/slack/');
$request->setRequestMethod('PATCH');
$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}}/targets/:target_id/integrations/slack/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/integrations/slack/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:target_id/integrations/slack/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/integrations/slack/"
payload = {
"notify_finding_fixed": False,
"notify_high_findings": False,
"notify_low_findings": False,
"notify_medium_findings": False,
"notify_scan_completed": False,
"notify_scan_started": False,
"webhook_url": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/integrations/slack/"
payload <- "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/integrations/slack/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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.patch('/baseUrl/targets/:target_id/integrations/slack/') do |req|
req.body = "{\n \"notify_finding_fixed\": false,\n \"notify_high_findings\": false,\n \"notify_low_findings\": false,\n \"notify_medium_findings\": false,\n \"notify_scan_completed\": false,\n \"notify_scan_started\": false,\n \"webhook_url\": \"\"\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}}/targets/:target_id/integrations/slack/";
let payload = json!({
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:target_id/integrations/slack/ \
--header 'content-type: application/json' \
--data '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}'
echo '{
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
}' | \
http PATCH {{baseUrl}}/targets/:target_id/integrations/slack/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "notify_finding_fixed": false,\n "notify_high_findings": false,\n "notify_low_findings": false,\n "notify_medium_findings": false,\n "notify_scan_completed": false,\n "notify_scan_started": false,\n "webhook_url": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:target_id/integrations/slack/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"notify_finding_fixed": false,
"notify_high_findings": false,
"notify_low_findings": false,
"notify_medium_findings": false,
"notify_scan_completed": false,
"notify_scan_started": false,
"webhook_url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/integrations/slack/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Average fix time graph data (all targets)
{{baseUrl}}/targets/all/average_fix_time/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/average_fix_time/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/average_fix_time/")
require "http/client"
url = "{{baseUrl}}/targets/all/average_fix_time/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/average_fix_time/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/average_fix_time/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/average_fix_time/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/average_fix_time/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/average_fix_time/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/average_fix_time/"))
.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}}/targets/all/average_fix_time/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/average_fix_time/")
.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}}/targets/all/average_fix_time/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/all/average_fix_time/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/average_fix_time/';
const options = {method: 'GET'};
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}}/targets/all/average_fix_time/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/average_fix_time/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/average_fix_time/',
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: 'GET',
url: '{{baseUrl}}/targets/all/average_fix_time/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/average_fix_time/');
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}}/targets/all/average_fix_time/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/average_fix_time/';
const options = {method: 'GET'};
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}}/targets/all/average_fix_time/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/average_fix_time/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/average_fix_time/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/average_fix_time/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/average_fix_time/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/average_fix_time/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/average_fix_time/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/average_fix_time/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/average_fix_time/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/average_fix_time/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/average_fix_time/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/average_fix_time/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/average_fix_time/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/average_fix_time/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/average_fix_time/
http GET {{baseUrl}}/targets/all/average_fix_time/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/average_fix_time/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/average_fix_time/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": {
"high": 2,
"low": 3,
"medium": 5
}
}
GET
Average vulnerability trend graph data
{{baseUrl}}/targets/:target_id/average_fix_time/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/average_fix_time/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/average_fix_time/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/average_fix_time/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/average_fix_time/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/average_fix_time/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/average_fix_time/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/average_fix_time/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/average_fix_time/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/average_fix_time/"))
.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}}/targets/:target_id/average_fix_time/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/average_fix_time/")
.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}}/targets/:target_id/average_fix_time/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/average_fix_time/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/average_fix_time/';
const options = {method: 'GET'};
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}}/targets/:target_id/average_fix_time/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/average_fix_time/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/average_fix_time/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/average_fix_time/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/average_fix_time/');
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}}/targets/:target_id/average_fix_time/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/average_fix_time/';
const options = {method: 'GET'};
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}}/targets/:target_id/average_fix_time/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/average_fix_time/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/average_fix_time/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/average_fix_time/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/average_fix_time/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/average_fix_time/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/average_fix_time/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/average_fix_time/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/average_fix_time/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/average_fix_time/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/average_fix_time/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/average_fix_time/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/average_fix_time/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/average_fix_time/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/average_fix_time/
http GET {{baseUrl}}/targets/:target_id/average_fix_time/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/average_fix_time/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/average_fix_time/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"results": {
"high": 2,
"low": 3,
"medium": 5
}
}
GET
Risk trend graph data (all targets)
{{baseUrl}}/targets/all/risk_trend/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/risk_trend/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/risk_trend/")
require "http/client"
url = "{{baseUrl}}/targets/all/risk_trend/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/risk_trend/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/risk_trend/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/risk_trend/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/risk_trend/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/risk_trend/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/risk_trend/"))
.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}}/targets/all/risk_trend/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/risk_trend/")
.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}}/targets/all/risk_trend/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/all/risk_trend/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/risk_trend/';
const options = {method: 'GET'};
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}}/targets/all/risk_trend/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/risk_trend/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/risk_trend/',
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: 'GET', url: '{{baseUrl}}/targets/all/risk_trend/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/risk_trend/');
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}}/targets/all/risk_trend/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/risk_trend/';
const options = {method: 'GET'};
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}}/targets/all/risk_trend/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/risk_trend/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/risk_trend/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/risk_trend/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/risk_trend/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/risk_trend/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/risk_trend/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/risk_trend/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/risk_trend/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/risk_trend/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/risk_trend/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/risk_trend/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/risk_trend/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/risk_trend/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/risk_trend/
http GET {{baseUrl}}/targets/all/risk_trend/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/risk_trend/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/risk_trend/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
Risk trend graph data
{{baseUrl}}/targets/:target_id/risk_trend/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/risk_trend/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/risk_trend/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/risk_trend/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/risk_trend/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/risk_trend/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/risk_trend/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/risk_trend/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/risk_trend/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/risk_trend/"))
.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}}/targets/:target_id/risk_trend/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/risk_trend/")
.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}}/targets/:target_id/risk_trend/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/risk_trend/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/risk_trend/';
const options = {method: 'GET'};
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}}/targets/:target_id/risk_trend/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/risk_trend/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/risk_trend/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/risk_trend/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/risk_trend/');
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}}/targets/:target_id/risk_trend/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/risk_trend/';
const options = {method: 'GET'};
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}}/targets/:target_id/risk_trend/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/risk_trend/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/risk_trend/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/risk_trend/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/risk_trend/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/risk_trend/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/risk_trend/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/risk_trend/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/risk_trend/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/risk_trend/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/risk_trend/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/risk_trend/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/risk_trend/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/risk_trend/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/risk_trend/
http GET {{baseUrl}}/targets/:target_id/risk_trend/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/risk_trend/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/risk_trend/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
Severity trend graph data (all targets)
{{baseUrl}}/targets/all/severity_trend/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/severity_trend/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/severity_trend/")
require "http/client"
url = "{{baseUrl}}/targets/all/severity_trend/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/severity_trend/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/severity_trend/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/severity_trend/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/severity_trend/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/severity_trend/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/severity_trend/"))
.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}}/targets/all/severity_trend/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/severity_trend/")
.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}}/targets/all/severity_trend/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/all/severity_trend/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/severity_trend/';
const options = {method: 'GET'};
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}}/targets/all/severity_trend/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/severity_trend/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/severity_trend/',
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: 'GET', url: '{{baseUrl}}/targets/all/severity_trend/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/severity_trend/');
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}}/targets/all/severity_trend/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/severity_trend/';
const options = {method: 'GET'};
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}}/targets/all/severity_trend/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/severity_trend/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/severity_trend/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/severity_trend/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/severity_trend/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/severity_trend/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/severity_trend/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/severity_trend/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/severity_trend/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/severity_trend/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/severity_trend/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/severity_trend/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/severity_trend/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/severity_trend/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/severity_trend/
http GET {{baseUrl}}/targets/all/severity_trend/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/severity_trend/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/severity_trend/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"step": 86400
}
GET
Severity trend graph data.
{{baseUrl}}/targets/:target_id/severity_trend/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/severity_trend/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/severity_trend/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/severity_trend/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/severity_trend/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/severity_trend/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/severity_trend/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/severity_trend/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/severity_trend/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/severity_trend/"))
.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}}/targets/:target_id/severity_trend/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/severity_trend/")
.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}}/targets/:target_id/severity_trend/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/severity_trend/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/severity_trend/';
const options = {method: 'GET'};
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}}/targets/:target_id/severity_trend/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/severity_trend/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/severity_trend/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/severity_trend/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/severity_trend/');
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}}/targets/:target_id/severity_trend/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/severity_trend/';
const options = {method: 'GET'};
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}}/targets/:target_id/severity_trend/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/severity_trend/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/severity_trend/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/severity_trend/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/severity_trend/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/severity_trend/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/severity_trend/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/severity_trend/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/severity_trend/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/severity_trend/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/severity_trend/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/severity_trend/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/severity_trend/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/severity_trend/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/severity_trend/
http GET {{baseUrl}}/targets/:target_id/severity_trend/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/severity_trend/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/severity_trend/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"step": 86400
}
GET
Targets with open vulnerabilities pie chart data
{{baseUrl}}/targets/all/needs_attention_pie/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/needs_attention_pie/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/needs_attention_pie/")
require "http/client"
url = "{{baseUrl}}/targets/all/needs_attention_pie/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/needs_attention_pie/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/needs_attention_pie/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/needs_attention_pie/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/needs_attention_pie/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/needs_attention_pie/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/needs_attention_pie/"))
.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}}/targets/all/needs_attention_pie/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/needs_attention_pie/")
.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}}/targets/all/needs_attention_pie/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/all/needs_attention_pie/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/needs_attention_pie/';
const options = {method: 'GET'};
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}}/targets/all/needs_attention_pie/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/needs_attention_pie/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/needs_attention_pie/',
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: 'GET',
url: '{{baseUrl}}/targets/all/needs_attention_pie/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/needs_attention_pie/');
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}}/targets/all/needs_attention_pie/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/needs_attention_pie/';
const options = {method: 'GET'};
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}}/targets/all/needs_attention_pie/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/needs_attention_pie/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/needs_attention_pie/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/needs_attention_pie/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/needs_attention_pie/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/needs_attention_pie/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/needs_attention_pie/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/needs_attention_pie/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/needs_attention_pie/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/needs_attention_pie/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/needs_attention_pie/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/needs_attention_pie/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/needs_attention_pie/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/needs_attention_pie/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/needs_attention_pie/
http GET {{baseUrl}}/targets/all/needs_attention_pie/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/needs_attention_pie/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/needs_attention_pie/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
Targets with open vulnerabilities
{{baseUrl}}/targets/all/needs_attention_top/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/needs_attention_top/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/needs_attention_top/")
require "http/client"
url = "{{baseUrl}}/targets/all/needs_attention_top/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/needs_attention_top/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/needs_attention_top/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/needs_attention_top/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/needs_attention_top/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/needs_attention_top/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/needs_attention_top/"))
.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}}/targets/all/needs_attention_top/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/needs_attention_top/")
.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}}/targets/all/needs_attention_top/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/all/needs_attention_top/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/needs_attention_top/';
const options = {method: 'GET'};
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}}/targets/all/needs_attention_top/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/needs_attention_top/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/needs_attention_top/',
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: 'GET',
url: '{{baseUrl}}/targets/all/needs_attention_top/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/needs_attention_top/');
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}}/targets/all/needs_attention_top/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/needs_attention_top/';
const options = {method: 'GET'};
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}}/targets/all/needs_attention_top/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/needs_attention_top/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/needs_attention_top/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/needs_attention_top/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/needs_attention_top/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/needs_attention_top/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/needs_attention_top/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/needs_attention_top/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/needs_attention_top/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/needs_attention_top/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/needs_attention_top/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/needs_attention_top/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/needs_attention_top/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/needs_attention_top/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/needs_attention_top/
http GET {{baseUrl}}/targets/all/needs_attention_top/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/needs_attention_top/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/needs_attention_top/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"highs": 3,
"id": "QJxMvgPebu0e",
"lows": 4,
"mediums": 8,
"name": "Probely",
"url": "https://probely.com"
}
]
GET
Top 5 vulnerabilities (all targets).
{{baseUrl}}/targets/all/top_vulns/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/all/top_vulns/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/all/top_vulns/")
require "http/client"
url = "{{baseUrl}}/targets/all/top_vulns/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/all/top_vulns/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/all/top_vulns/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/all/top_vulns/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/all/top_vulns/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/all/top_vulns/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/all/top_vulns/"))
.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}}/targets/all/top_vulns/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/all/top_vulns/")
.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}}/targets/all/top_vulns/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/all/top_vulns/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/all/top_vulns/';
const options = {method: 'GET'};
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}}/targets/all/top_vulns/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/all/top_vulns/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/all/top_vulns/',
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: 'GET', url: '{{baseUrl}}/targets/all/top_vulns/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/all/top_vulns/');
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}}/targets/all/top_vulns/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/all/top_vulns/';
const options = {method: 'GET'};
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}}/targets/all/top_vulns/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/all/top_vulns/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/all/top_vulns/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/all/top_vulns/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/all/top_vulns/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/all/top_vulns/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/all/top_vulns/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/all/top_vulns/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/all/top_vulns/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/all/top_vulns/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/all/top_vulns/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/all/top_vulns/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/all/top_vulns/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/all/top_vulns/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/all/top_vulns/
http GET {{baseUrl}}/targets/all/top_vulns/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/all/top_vulns/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/all/top_vulns/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
Top 5 vulnerabilities
{{baseUrl}}/targets/:target_id/top_vulns/
QUERY PARAMS
target_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:target_id/top_vulns/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:target_id/top_vulns/")
require "http/client"
url = "{{baseUrl}}/targets/:target_id/top_vulns/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:target_id/top_vulns/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:target_id/top_vulns/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:target_id/top_vulns/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:target_id/top_vulns/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:target_id/top_vulns/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:target_id/top_vulns/"))
.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}}/targets/:target_id/top_vulns/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:target_id/top_vulns/")
.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}}/targets/:target_id/top_vulns/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/targets/:target_id/top_vulns/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:target_id/top_vulns/';
const options = {method: 'GET'};
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}}/targets/:target_id/top_vulns/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:target_id/top_vulns/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:target_id/top_vulns/',
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: 'GET',
url: '{{baseUrl}}/targets/:target_id/top_vulns/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:target_id/top_vulns/');
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}}/targets/:target_id/top_vulns/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:target_id/top_vulns/';
const options = {method: 'GET'};
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}}/targets/:target_id/top_vulns/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:target_id/top_vulns/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:target_id/top_vulns/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:target_id/top_vulns/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:target_id/top_vulns/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:target_id/top_vulns/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:target_id/top_vulns/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:target_id/top_vulns/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:target_id/top_vulns/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:target_id/top_vulns/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:target_id/top_vulns/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:target_id/top_vulns/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:target_id/top_vulns/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:target_id/top_vulns/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:target_id/top_vulns/
http GET {{baseUrl}}/targets/:target_id/top_vulns/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:target_id/top_vulns/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:target_id/top_vulns/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
Create target
{{baseUrl}}/targets/
BODY json
{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/");
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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/targets/" {:content-type :json
:form-params {:allowed_scan_profiles [{:id ""
:name ""}]
:assets [{:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:headers [{:name ""
:value ""}]
:host ""
:id ""
:include false
:name ""
:stack []
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false}]
:changed ""
:changed_by {}
:connected_target ""
:enabled false
:environment ""
:id ""
:labels []
:name ""
:report_type ""
:scan_profile ""
:site {:basic_auth {:password ""
:username ""}
:changed ""
:changed_by {}
:cookies [{}]
:desc ""
:form_login [{:name ""
:value ""}]
:form_login_check_pattern ""
:form_login_url ""
:has_basic_auth false
:has_form_login false
:headers [{}]
:host ""
:id ""
:name ""
:stack []
:url ""
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false
:whitelist []}
:type ""}})
require "http/client"
url = "{{baseUrl}}/targets/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/"),
Content = new StringContent("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/"
payload := strings.NewReader("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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/targets/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1538
{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/targets/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/targets/")
.header("content-type", "application/json")
.body("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowed_scan_profiles: [
{
id: '',
name: ''
}
],
assets: [
{
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {},
cookies: [
{}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/targets/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/',
headers: {'content-type': 'application/json'},
data: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowed_scan_profiles":[{"id":"","name":""}],"assets":[{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}],"changed":"","changed_by":{},"connected_target":"","enabled":false,"environment":"","id":"","labels":[],"name":"","report_type":"","scan_profile":"","site":{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{},"cookies":[{}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]},"type":""}'
};
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}}/targets/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowed_scan_profiles": [\n {\n "id": "",\n "name": ""\n }\n ],\n "assets": [\n {\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n }\n ],\n "changed": "",\n "changed_by": {},\n "connected_target": "",\n "enabled": false,\n "environment": "",\n "id": "",\n "labels": [],\n "name": "",\n "report_type": "",\n "scan_profile": "",\n "site": {\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {},\n "cookies": [\n {}\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {}\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n },\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/")
.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/targets/',
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({
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/targets/',
headers: {'content-type': 'application/json'},
body: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
},
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}}/targets/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowed_scan_profiles: [
{
id: '',
name: ''
}
],
assets: [
{
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {},
cookies: [
{}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
});
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}}/targets/',
headers: {'content-type': 'application/json'},
data: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowed_scan_profiles":[{"id":"","name":""}],"assets":[{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}],"changed":"","changed_by":{},"connected_target":"","enabled":false,"environment":"","id":"","labels":[],"name":"","report_type":"","scan_profile":"","site":{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{},"cookies":[{}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]},"type":""}'
};
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 = @{ @"allowed_scan_profiles": @[ @{ @"id": @"", @"name": @"" } ],
@"assets": @[ @{ @"changed": @"", @"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" }, @"cookies": @[ @{ @"name": @"", @"value": @"" } ], @"desc": @"", @"headers": @[ @{ @"name": @"", @"value": @"" } ], @"host": @"", @"id": @"", @"include": @NO, @"name": @"", @"stack": @[ ], @"verification_date": @"", @"verification_last_error": @"", @"verification_method": @"", @"verification_token": @"", @"verified": @NO } ],
@"changed": @"",
@"changed_by": @{ },
@"connected_target": @"",
@"enabled": @NO,
@"environment": @"",
@"id": @"",
@"labels": @[ ],
@"name": @"",
@"report_type": @"",
@"scan_profile": @"",
@"site": @{ @"basic_auth": @{ @"password": @"", @"username": @"" }, @"changed": @"", @"changed_by": @{ }, @"cookies": @[ @{ } ], @"desc": @"", @"form_login": @[ @{ @"name": @"", @"value": @"" } ], @"form_login_check_pattern": @"", @"form_login_url": @"", @"has_basic_auth": @NO, @"has_form_login": @NO, @"headers": @[ @{ } ], @"host": @"", @"id": @"", @"name": @"", @"stack": @[ ], @"url": @"", @"verification_date": @"", @"verification_last_error": @"", @"verification_method": @"", @"verification_token": @"", @"verified": @NO, @"whitelist": @[ ] },
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/"]
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}}/targets/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/",
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([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]),
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}}/targets/', [
'body' => '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/');
$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}}/targets/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/targets/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/"
payload = {
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": False,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": False,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [{}],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": False,
"has_form_login": False,
"headers": [{}],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False,
"whitelist": []
},
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/"
payload <- "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/")
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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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/targets/') do |req|
req.body = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/";
let payload = json!({
"allowed_scan_profiles": (
json!({
"id": "",
"name": ""
})
),
"assets": (
json!({
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"include": false,
"name": "",
"stack": (),
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
})
),
"changed": "",
"changed_by": json!({}),
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": (),
"name": "",
"report_type": "",
"scan_profile": "",
"site": json!({
"basic_auth": json!({
"password": "",
"username": ""
}),
"changed": "",
"changed_by": json!({}),
"cookies": (json!({})),
"desc": "",
"form_login": (
json!({
"name": "",
"value": ""
})
),
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": (json!({})),
"host": "",
"id": "",
"name": "",
"stack": (),
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": ()
}),
"type": ""
});
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}}/targets/ \
--header 'content-type: application/json' \
--data '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
echo '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}' | \
http POST {{baseUrl}}/targets/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "allowed_scan_profiles": [\n {\n "id": "",\n "name": ""\n }\n ],\n "assets": [\n {\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n }\n ],\n "changed": "",\n "changed_by": {},\n "connected_target": "",\n "enabled": false,\n "environment": "",\n "id": "",\n "labels": [],\n "name": "",\n "report_type": "",\n "scan_profile": "",\n "site": {\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {},\n "cookies": [\n {}\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {}\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n },\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/targets/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowed_scan_profiles": [
[
"id": "",
"name": ""
]
],
"assets": [
[
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
]
],
"changed": "",
"changed_by": [],
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": [
"basic_auth": [
"password": "",
"username": ""
],
"changed": "",
"changed_by": [],
"cookies": [[]],
"desc": "",
"form_login": [
[
"name": "",
"value": ""
]
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [[]],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
],
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name",
"scan_profile": "normal",
"site": {
"changed": "2018-01-31T16:32:17.238553Z",
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Internal server error."
}
DELETE
Delete target
{{baseUrl}}/targets/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/targets/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/targets/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/targets/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/targets/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:id/"))
.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}}/targets/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/targets/:id/")
.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}}/targets/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/targets/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:id/';
const options = {method: 'DELETE'};
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}}/targets/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:id/',
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: 'DELETE', url: '{{baseUrl}}/targets/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/targets/:id/');
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}}/targets/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:id/';
const options = {method: 'DELETE'};
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}}/targets/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/targets/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/targets/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/targets/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/targets/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/targets/:id/
http DELETE {{baseUrl}}/targets/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/targets/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List targets
{{baseUrl}}/targets/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/")
require "http/client"
url = "{{baseUrl}}/targets/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/"))
.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}}/targets/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/")
.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}}/targets/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/';
const options = {method: 'GET'};
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}}/targets/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/',
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: 'GET', url: '{{baseUrl}}/targets/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/');
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}}/targets/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/';
const options = {method: 'GET'};
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}}/targets/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/
http GET {{baseUrl}}/targets/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"length": 10,
"page": 1,
"page_total": 1,
"pagination_count": 6
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Internal server error."
}
PATCH
Partial update target
{{baseUrl}}/targets/:id/
QUERY PARAMS
id
BODY json
{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:id/");
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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/targets/:id/" {:content-type :json
:form-params {:allowed_scan_profiles [{:id ""
:name ""}]
:assets [{:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:headers [{:name ""
:value ""}]
:host ""
:id ""
:include false
:name ""
:stack []
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false}]
:changed ""
:changed_by {}
:connected_target ""
:enabled false
:environment ""
:id ""
:labels []
:name ""
:report_type ""
:scan_profile ""
:site {:basic_auth {:password ""
:username ""}
:changed ""
:changed_by {}
:cookies [{}]
:desc ""
:form_login [{:name ""
:value ""}]
:form_login_check_pattern ""
:form_login_url ""
:has_basic_auth false
:has_form_login false
:headers [{}]
:host ""
:id ""
:name ""
:stack []
:url ""
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false
:whitelist []}
:type ""}})
require "http/client"
url = "{{baseUrl}}/targets/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/targets/:id/"),
Content = new StringContent("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:id/"
payload := strings.NewReader("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/targets/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1538
{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/targets/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/targets/:id/")
.header("content-type", "application/json")
.body("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowed_scan_profiles: [
{
id: '',
name: ''
}
],
assets: [
{
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {},
cookies: [
{}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/targets/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:id/',
headers: {'content-type': 'application/json'},
data: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"allowed_scan_profiles":[{"id":"","name":""}],"assets":[{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}],"changed":"","changed_by":{},"connected_target":"","enabled":false,"environment":"","id":"","labels":[],"name":"","report_type":"","scan_profile":"","site":{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{},"cookies":[{}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]},"type":""}'
};
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}}/targets/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowed_scan_profiles": [\n {\n "id": "",\n "name": ""\n }\n ],\n "assets": [\n {\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n }\n ],\n "changed": "",\n "changed_by": {},\n "connected_target": "",\n "enabled": false,\n "environment": "",\n "id": "",\n "labels": [],\n "name": "",\n "report_type": "",\n "scan_profile": "",\n "site": {\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {},\n "cookies": [\n {}\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {}\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n },\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:id/',
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({
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/targets/:id/',
headers: {'content-type': 'application/json'},
body: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/targets/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowed_scan_profiles: [
{
id: '',
name: ''
}
],
assets: [
{
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {},
cookies: [
{}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
});
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}}/targets/:id/',
headers: {'content-type': 'application/json'},
data: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"allowed_scan_profiles":[{"id":"","name":""}],"assets":[{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}],"changed":"","changed_by":{},"connected_target":"","enabled":false,"environment":"","id":"","labels":[],"name":"","report_type":"","scan_profile":"","site":{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{},"cookies":[{}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]},"type":""}'
};
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 = @{ @"allowed_scan_profiles": @[ @{ @"id": @"", @"name": @"" } ],
@"assets": @[ @{ @"changed": @"", @"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" }, @"cookies": @[ @{ @"name": @"", @"value": @"" } ], @"desc": @"", @"headers": @[ @{ @"name": @"", @"value": @"" } ], @"host": @"", @"id": @"", @"include": @NO, @"name": @"", @"stack": @[ ], @"verification_date": @"", @"verification_last_error": @"", @"verification_method": @"", @"verification_token": @"", @"verified": @NO } ],
@"changed": @"",
@"changed_by": @{ },
@"connected_target": @"",
@"enabled": @NO,
@"environment": @"",
@"id": @"",
@"labels": @[ ],
@"name": @"",
@"report_type": @"",
@"scan_profile": @"",
@"site": @{ @"basic_auth": @{ @"password": @"", @"username": @"" }, @"changed": @"", @"changed_by": @{ }, @"cookies": @[ @{ } ], @"desc": @"", @"form_login": @[ @{ @"name": @"", @"value": @"" } ], @"form_login_check_pattern": @"", @"form_login_url": @"", @"has_basic_auth": @NO, @"has_form_login": @NO, @"headers": @[ @{ } ], @"host": @"", @"id": @"", @"name": @"", @"stack": @[ ], @"url": @"", @"verification_date": @"", @"verification_last_error": @"", @"verification_method": @"", @"verification_token": @"", @"verified": @NO, @"whitelist": @[ ] },
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/targets/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]),
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('PATCH', '{{baseUrl}}/targets/:id/', [
'body' => '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:id/');
$request->setRequestMethod('PATCH');
$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}}/targets/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/targets/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:id/"
payload = {
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": False,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": False,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [{}],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": False,
"has_form_login": False,
"headers": [{}],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False,
"whitelist": []
},
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:id/"
payload <- "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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.patch('/baseUrl/targets/:id/') do |req|
req.body = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/:id/";
let payload = json!({
"allowed_scan_profiles": (
json!({
"id": "",
"name": ""
})
),
"assets": (
json!({
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"include": false,
"name": "",
"stack": (),
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
})
),
"changed": "",
"changed_by": json!({}),
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": (),
"name": "",
"report_type": "",
"scan_profile": "",
"site": json!({
"basic_auth": json!({
"password": "",
"username": ""
}),
"changed": "",
"changed_by": json!({}),
"cookies": (json!({})),
"desc": "",
"form_login": (
json!({
"name": "",
"value": ""
})
),
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": (json!({})),
"host": "",
"id": "",
"name": "",
"stack": (),
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": ()
}),
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/targets/:id/ \
--header 'content-type: application/json' \
--data '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
echo '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}' | \
http PATCH {{baseUrl}}/targets/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "allowed_scan_profiles": [\n {\n "id": "",\n "name": ""\n }\n ],\n "assets": [\n {\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n }\n ],\n "changed": "",\n "changed_by": {},\n "connected_target": "",\n "enabled": false,\n "environment": "",\n "id": "",\n "labels": [],\n "name": "",\n "report_type": "",\n "scan_profile": "",\n "site": {\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {},\n "cookies": [\n {}\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {}\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n },\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowed_scan_profiles": [
[
"id": "",
"name": ""
]
],
"assets": [
[
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
]
],
"changed": "",
"changed_by": [],
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": [
"basic_auth": [
"password": "",
"username": ""
],
"changed": "",
"changed_by": [],
"cookies": [[]],
"desc": "",
"form_login": [
[
"name": "",
"value": ""
]
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [[]],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
],
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name",
"scan_profile": "normal",
"site": {
"changed": "2018-01-31T16:32:17.238553Z",
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve target
{{baseUrl}}/targets/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/targets/:id/")
require "http/client"
url = "{{baseUrl}}/targets/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/targets/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/targets/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/targets/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/targets/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:id/"))
.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}}/targets/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/targets/:id/")
.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}}/targets/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/targets/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:id/';
const options = {method: 'GET'};
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}}/targets/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/targets/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/targets/:id/',
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: 'GET', url: '{{baseUrl}}/targets/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/targets/:id/');
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}}/targets/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:id/';
const options = {method: 'GET'};
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}}/targets/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/targets/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/targets/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/targets/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/targets/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/targets/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/targets/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/targets/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/targets/:id/
http GET {{baseUrl}}/targets/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/targets/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name",
"scan_profile": "normal",
"site": {
"changed": "2018-01-31T16:32:17.238553Z",
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Internal server error."
}
PUT
Update target
{{baseUrl}}/targets/:id/
QUERY PARAMS
id
BODY json
{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/targets/:id/");
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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/targets/:id/" {:content-type :json
:form-params {:allowed_scan_profiles [{:id ""
:name ""}]
:assets [{:changed ""
:changed_by {:email ""
:id ""
:name ""}
:cookies [{:name ""
:value ""}]
:desc ""
:headers [{:name ""
:value ""}]
:host ""
:id ""
:include false
:name ""
:stack []
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false}]
:changed ""
:changed_by {}
:connected_target ""
:enabled false
:environment ""
:id ""
:labels []
:name ""
:report_type ""
:scan_profile ""
:site {:basic_auth {:password ""
:username ""}
:changed ""
:changed_by {}
:cookies [{}]
:desc ""
:form_login [{:name ""
:value ""}]
:form_login_check_pattern ""
:form_login_url ""
:has_basic_auth false
:has_form_login false
:headers [{}]
:host ""
:id ""
:name ""
:stack []
:url ""
:verification_date ""
:verification_last_error ""
:verification_method ""
:verification_token ""
:verified false
:whitelist []}
:type ""}})
require "http/client"
url = "{{baseUrl}}/targets/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/:id/"),
Content = new StringContent("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/targets/:id/"
payload := strings.NewReader("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/targets/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1538
{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/targets/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/targets/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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 \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/targets/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/targets/:id/")
.header("content-type", "application/json")
.body("{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowed_scan_profiles: [
{
id: '',
name: ''
}
],
assets: [
{
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {},
cookies: [
{}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/targets/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:id/',
headers: {'content-type': 'application/json'},
data: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/targets/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowed_scan_profiles":[{"id":"","name":""}],"assets":[{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}],"changed":"","changed_by":{},"connected_target":"","enabled":false,"environment":"","id":"","labels":[],"name":"","report_type":"","scan_profile":"","site":{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{},"cookies":[{}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]},"type":""}'
};
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}}/targets/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowed_scan_profiles": [\n {\n "id": "",\n "name": ""\n }\n ],\n "assets": [\n {\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n }\n ],\n "changed": "",\n "changed_by": {},\n "connected_target": "",\n "enabled": false,\n "environment": "",\n "id": "",\n "labels": [],\n "name": "",\n "report_type": "",\n "scan_profile": "",\n "site": {\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {},\n "cookies": [\n {}\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {}\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n },\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/targets/:id/")
.put(body)
.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/targets/:id/',
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({
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/targets/:id/',
headers: {'content-type': 'application/json'},
body: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
},
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}}/targets/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowed_scan_profiles: [
{
id: '',
name: ''
}
],
assets: [
{
changed: '',
changed_by: {
email: '',
id: '',
name: ''
},
cookies: [
{
name: '',
value: ''
}
],
desc: '',
headers: [
{
name: '',
value: ''
}
],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {
password: '',
username: ''
},
changed: '',
changed_by: {},
cookies: [
{}
],
desc: '',
form_login: [
{
name: '',
value: ''
}
],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [
{}
],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
});
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}}/targets/:id/',
headers: {'content-type': 'application/json'},
data: {
allowed_scan_profiles: [{id: '', name: ''}],
assets: [
{
changed: '',
changed_by: {email: '', id: '', name: ''},
cookies: [{name: '', value: ''}],
desc: '',
headers: [{name: '', value: ''}],
host: '',
id: '',
include: false,
name: '',
stack: [],
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false
}
],
changed: '',
changed_by: {},
connected_target: '',
enabled: false,
environment: '',
id: '',
labels: [],
name: '',
report_type: '',
scan_profile: '',
site: {
basic_auth: {password: '', username: ''},
changed: '',
changed_by: {},
cookies: [{}],
desc: '',
form_login: [{name: '', value: ''}],
form_login_check_pattern: '',
form_login_url: '',
has_basic_auth: false,
has_form_login: false,
headers: [{}],
host: '',
id: '',
name: '',
stack: [],
url: '',
verification_date: '',
verification_last_error: '',
verification_method: '',
verification_token: '',
verified: false,
whitelist: []
},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/targets/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"allowed_scan_profiles":[{"id":"","name":""}],"assets":[{"changed":"","changed_by":{"email":"","id":"","name":""},"cookies":[{"name":"","value":""}],"desc":"","headers":[{"name":"","value":""}],"host":"","id":"","include":false,"name":"","stack":[],"verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false}],"changed":"","changed_by":{},"connected_target":"","enabled":false,"environment":"","id":"","labels":[],"name":"","report_type":"","scan_profile":"","site":{"basic_auth":{"password":"","username":""},"changed":"","changed_by":{},"cookies":[{}],"desc":"","form_login":[{"name":"","value":""}],"form_login_check_pattern":"","form_login_url":"","has_basic_auth":false,"has_form_login":false,"headers":[{}],"host":"","id":"","name":"","stack":[],"url":"","verification_date":"","verification_last_error":"","verification_method":"","verification_token":"","verified":false,"whitelist":[]},"type":""}'
};
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 = @{ @"allowed_scan_profiles": @[ @{ @"id": @"", @"name": @"" } ],
@"assets": @[ @{ @"changed": @"", @"changed_by": @{ @"email": @"", @"id": @"", @"name": @"" }, @"cookies": @[ @{ @"name": @"", @"value": @"" } ], @"desc": @"", @"headers": @[ @{ @"name": @"", @"value": @"" } ], @"host": @"", @"id": @"", @"include": @NO, @"name": @"", @"stack": @[ ], @"verification_date": @"", @"verification_last_error": @"", @"verification_method": @"", @"verification_token": @"", @"verified": @NO } ],
@"changed": @"",
@"changed_by": @{ },
@"connected_target": @"",
@"enabled": @NO,
@"environment": @"",
@"id": @"",
@"labels": @[ ],
@"name": @"",
@"report_type": @"",
@"scan_profile": @"",
@"site": @{ @"basic_auth": @{ @"password": @"", @"username": @"" }, @"changed": @"", @"changed_by": @{ }, @"cookies": @[ @{ } ], @"desc": @"", @"form_login": @[ @{ @"name": @"", @"value": @"" } ], @"form_login_check_pattern": @"", @"form_login_url": @"", @"has_basic_auth": @NO, @"has_form_login": @NO, @"headers": @[ @{ } ], @"host": @"", @"id": @"", @"name": @"", @"stack": @[ ], @"url": @"", @"verification_date": @"", @"verification_last_error": @"", @"verification_method": @"", @"verification_token": @"", @"verified": @NO, @"whitelist": @[ ] },
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/targets/:id/"]
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}}/targets/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/targets/:id/",
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([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]),
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('PUT', '{{baseUrl}}/targets/:id/', [
'body' => '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/targets/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowed_scan_profiles' => [
[
'id' => '',
'name' => ''
]
],
'assets' => [
[
'changed' => '',
'changed_by' => [
'email' => '',
'id' => '',
'name' => ''
],
'cookies' => [
[
'name' => '',
'value' => ''
]
],
'desc' => '',
'headers' => [
[
'name' => '',
'value' => ''
]
],
'host' => '',
'id' => '',
'include' => null,
'name' => '',
'stack' => [
],
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null
]
],
'changed' => '',
'changed_by' => [
],
'connected_target' => '',
'enabled' => null,
'environment' => '',
'id' => '',
'labels' => [
],
'name' => '',
'report_type' => '',
'scan_profile' => '',
'site' => [
'basic_auth' => [
'password' => '',
'username' => ''
],
'changed' => '',
'changed_by' => [
],
'cookies' => [
[
]
],
'desc' => '',
'form_login' => [
[
'name' => '',
'value' => ''
]
],
'form_login_check_pattern' => '',
'form_login_url' => '',
'has_basic_auth' => null,
'has_form_login' => null,
'headers' => [
[
]
],
'host' => '',
'id' => '',
'name' => '',
'stack' => [
],
'url' => '',
'verification_date' => '',
'verification_last_error' => '',
'verification_method' => '',
'verification_token' => '',
'verified' => null,
'whitelist' => [
]
],
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/targets/:id/');
$request->setRequestMethod('PUT');
$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}}/targets/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/targets/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/targets/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/targets/:id/"
payload = {
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": False,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": False,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [{}],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": False,
"has_form_login": False,
"headers": [{}],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": False,
"whitelist": []
},
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/targets/:id/"
payload <- "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/targets/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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/targets/:id/') do |req|
req.body = "{\n \"allowed_scan_profiles\": [\n {\n \"id\": \"\",\n \"name\": \"\"\n }\n ],\n \"assets\": [\n {\n \"changed\": \"\",\n \"changed_by\": {\n \"email\": \"\",\n \"id\": \"\",\n \"name\": \"\"\n },\n \"cookies\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"desc\": \"\",\n \"headers\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"include\": false,\n \"name\": \"\",\n \"stack\": [],\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false\n }\n ],\n \"changed\": \"\",\n \"changed_by\": {},\n \"connected_target\": \"\",\n \"enabled\": false,\n \"environment\": \"\",\n \"id\": \"\",\n \"labels\": [],\n \"name\": \"\",\n \"report_type\": \"\",\n \"scan_profile\": \"\",\n \"site\": {\n \"basic_auth\": {\n \"password\": \"\",\n \"username\": \"\"\n },\n \"changed\": \"\",\n \"changed_by\": {},\n \"cookies\": [\n {}\n ],\n \"desc\": \"\",\n \"form_login\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"form_login_check_pattern\": \"\",\n \"form_login_url\": \"\",\n \"has_basic_auth\": false,\n \"has_form_login\": false,\n \"headers\": [\n {}\n ],\n \"host\": \"\",\n \"id\": \"\",\n \"name\": \"\",\n \"stack\": [],\n \"url\": \"\",\n \"verification_date\": \"\",\n \"verification_last_error\": \"\",\n \"verification_method\": \"\",\n \"verification_token\": \"\",\n \"verified\": false,\n \"whitelist\": []\n },\n \"type\": \"\"\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}}/targets/:id/";
let payload = json!({
"allowed_scan_profiles": (
json!({
"id": "",
"name": ""
})
),
"assets": (
json!({
"changed": "",
"changed_by": json!({
"email": "",
"id": "",
"name": ""
}),
"cookies": (
json!({
"name": "",
"value": ""
})
),
"desc": "",
"headers": (
json!({
"name": "",
"value": ""
})
),
"host": "",
"id": "",
"include": false,
"name": "",
"stack": (),
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
})
),
"changed": "",
"changed_by": json!({}),
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": (),
"name": "",
"report_type": "",
"scan_profile": "",
"site": json!({
"basic_auth": json!({
"password": "",
"username": ""
}),
"changed": "",
"changed_by": json!({}),
"cookies": (json!({})),
"desc": "",
"form_login": (
json!({
"name": "",
"value": ""
})
),
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": (json!({})),
"host": "",
"id": "",
"name": "",
"stack": (),
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": ()
}),
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/targets/:id/ \
--header 'content-type: application/json' \
--data '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}'
echo '{
"allowed_scan_profiles": [
{
"id": "",
"name": ""
}
],
"assets": [
{
"changed": "",
"changed_by": {
"email": "",
"id": "",
"name": ""
},
"cookies": [
{
"name": "",
"value": ""
}
],
"desc": "",
"headers": [
{
"name": "",
"value": ""
}
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
}
],
"changed": "",
"changed_by": {},
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": {
"basic_auth": {
"password": "",
"username": ""
},
"changed": "",
"changed_by": {},
"cookies": [
{}
],
"desc": "",
"form_login": [
{
"name": "",
"value": ""
}
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [
{}
],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
},
"type": ""
}' | \
http PUT {{baseUrl}}/targets/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "allowed_scan_profiles": [\n {\n "id": "",\n "name": ""\n }\n ],\n "assets": [\n {\n "changed": "",\n "changed_by": {\n "email": "",\n "id": "",\n "name": ""\n },\n "cookies": [\n {\n "name": "",\n "value": ""\n }\n ],\n "desc": "",\n "headers": [\n {\n "name": "",\n "value": ""\n }\n ],\n "host": "",\n "id": "",\n "include": false,\n "name": "",\n "stack": [],\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false\n }\n ],\n "changed": "",\n "changed_by": {},\n "connected_target": "",\n "enabled": false,\n "environment": "",\n "id": "",\n "labels": [],\n "name": "",\n "report_type": "",\n "scan_profile": "",\n "site": {\n "basic_auth": {\n "password": "",\n "username": ""\n },\n "changed": "",\n "changed_by": {},\n "cookies": [\n {}\n ],\n "desc": "",\n "form_login": [\n {\n "name": "",\n "value": ""\n }\n ],\n "form_login_check_pattern": "",\n "form_login_url": "",\n "has_basic_auth": false,\n "has_form_login": false,\n "headers": [\n {}\n ],\n "host": "",\n "id": "",\n "name": "",\n "stack": [],\n "url": "",\n "verification_date": "",\n "verification_last_error": "",\n "verification_method": "",\n "verification_token": "",\n "verified": false,\n "whitelist": []\n },\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/targets/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowed_scan_profiles": [
[
"id": "",
"name": ""
]
],
"assets": [
[
"changed": "",
"changed_by": [
"email": "",
"id": "",
"name": ""
],
"cookies": [
[
"name": "",
"value": ""
]
],
"desc": "",
"headers": [
[
"name": "",
"value": ""
]
],
"host": "",
"id": "",
"include": false,
"name": "",
"stack": [],
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false
]
],
"changed": "",
"changed_by": [],
"connected_target": "",
"enabled": false,
"environment": "",
"id": "",
"labels": [],
"name": "",
"report_type": "",
"scan_profile": "",
"site": [
"basic_auth": [
"password": "",
"username": ""
],
"changed": "",
"changed_by": [],
"cookies": [[]],
"desc": "",
"form_login": [
[
"name": "",
"value": ""
]
],
"form_login_check_pattern": "",
"form_login_url": "",
"has_basic_auth": false,
"has_form_login": false,
"headers": [[]],
"host": "",
"id": "",
"name": "",
"stack": [],
"url": "",
"verification_date": "",
"verification_last_error": "",
"verification_method": "",
"verification_token": "",
"verified": false,
"whitelist": []
],
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/targets/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"id": "jMXUw-BE_2vd",
"name": "Object name",
"scan_profile": "normal",
"site": {
"changed": "2018-01-31T16:32:17.238553Z",
"desc": "Object description",
"form_login_url": "https://app.probely.com/",
"has_basic_auth": true,
"has_form_login": true,
"host": "app.probely.com",
"id": "jMXUw-BE_2vd",
"name": "Object name",
"url": "https://app.probely.com",
"verification_date": "2018-01-31T16:32:52.226652Z",
"verification_token": "a38351cb-ede8-4dc8-9366-80d3a7042d9a"
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Change user password
{{baseUrl}}/profile/change_password/
BODY json
{
"confpassword": "",
"current_password": "",
"password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/profile/change_password/");
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 \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/profile/change_password/" {:content-type :json
:form-params {:confpassword ""
:current_password ""
:password ""}})
require "http/client"
url = "{{baseUrl}}/profile/change_password/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"confpassword\": \"\",\n \"current_password\": \"\",\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}}/profile/change_password/"),
Content = new StringContent("{\n \"confpassword\": \"\",\n \"current_password\": \"\",\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}}/profile/change_password/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/profile/change_password/"
payload := strings.NewReader("{\n \"confpassword\": \"\",\n \"current_password\": \"\",\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/profile/change_password/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 68
{
"confpassword": "",
"current_password": "",
"password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/profile/change_password/")
.setHeader("content-type", "application/json")
.setBody("{\n \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/profile/change_password/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"confpassword\": \"\",\n \"current_password\": \"\",\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 \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/profile/change_password/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/profile/change_password/")
.header("content-type", "application/json")
.body("{\n \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}")
.asString();
const data = JSON.stringify({
confpassword: '',
current_password: '',
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}}/profile/change_password/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/profile/change_password/',
headers: {'content-type': 'application/json'},
data: {confpassword: '', current_password: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/profile/change_password/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"confpassword":"","current_password":"","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}}/profile/change_password/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "confpassword": "",\n "current_password": "",\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 \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/profile/change_password/")
.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/profile/change_password/',
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({confpassword: '', current_password: '', password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/profile/change_password/',
headers: {'content-type': 'application/json'},
body: {confpassword: '', current_password: '', 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}}/profile/change_password/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
confpassword: '',
current_password: '',
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}}/profile/change_password/',
headers: {'content-type': 'application/json'},
data: {confpassword: '', current_password: '', password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/profile/change_password/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"confpassword":"","current_password":"","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 = @{ @"confpassword": @"",
@"current_password": @"",
@"password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/profile/change_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}}/profile/change_password/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/profile/change_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([
'confpassword' => '',
'current_password' => '',
'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}}/profile/change_password/', [
'body' => '{
"confpassword": "",
"current_password": "",
"password": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/profile/change_password/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'confpassword' => '',
'current_password' => '',
'password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'confpassword' => '',
'current_password' => '',
'password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/profile/change_password/');
$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}}/profile/change_password/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"confpassword": "",
"current_password": "",
"password": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/profile/change_password/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"confpassword": "",
"current_password": "",
"password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"confpassword\": \"\",\n \"current_password\": \"\",\n \"password\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/profile/change_password/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/profile/change_password/"
payload = {
"confpassword": "",
"current_password": "",
"password": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/profile/change_password/"
payload <- "{\n \"confpassword\": \"\",\n \"current_password\": \"\",\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}}/profile/change_password/")
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 \"confpassword\": \"\",\n \"current_password\": \"\",\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/profile/change_password/') do |req|
req.body = "{\n \"confpassword\": \"\",\n \"current_password\": \"\",\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}}/profile/change_password/";
let payload = json!({
"confpassword": "",
"current_password": "",
"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}}/profile/change_password/ \
--header 'content-type: application/json' \
--data '{
"confpassword": "",
"current_password": "",
"password": ""
}'
echo '{
"confpassword": "",
"current_password": "",
"password": ""
}' | \
http POST {{baseUrl}}/profile/change_password/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "confpassword": "",\n "current_password": "",\n "password": ""\n}' \
--output-document \
- {{baseUrl}}/profile/change_password/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"confpassword": "",
"current_password": "",
"password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/profile/change_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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
POST
Create-Reactivate a user.
{{baseUrl}}/users/
BODY json
{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/");
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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/users/" {:content-type :json
:form-params {:email ""
:is_admin false
:name ""
:title ""}})
require "http/client"
url = "{{baseUrl}}/users/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/"),
Content = new StringContent("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/users/"
payload := strings.NewReader("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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/users/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/users/")
.setHeader("content-type", "application/json")
.setBody("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/users/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/users/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/users/")
.header("content-type", "application/json")
.body("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
email: '',
is_admin: false,
name: '',
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/users/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/users/',
headers: {'content-type': 'application/json'},
data: {email: '', is_admin: false, name: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/users/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"email":"","is_admin":false,"name":"","title":""}'
};
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}}/users/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "email": "",\n "is_admin": false,\n "name": "",\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/users/")
.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/users/',
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({email: '', is_admin: false, name: '', title: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/users/',
headers: {'content-type': 'application/json'},
body: {email: '', is_admin: false, name: '', title: ''},
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}}/users/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
email: '',
is_admin: false,
name: '',
title: ''
});
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}}/users/',
headers: {'content-type': 'application/json'},
data: {email: '', is_admin: false, name: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/users/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"email":"","is_admin":false,"name":"","title":""}'
};
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 = @{ @"email": @"",
@"is_admin": @NO,
@"name": @"",
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/"]
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}}/users/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/users/",
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([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]),
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}}/users/', [
'body' => '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/users/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/users/');
$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}}/users/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/users/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/users/"
payload = {
"email": "",
"is_admin": False,
"name": "",
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/users/"
payload <- "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/")
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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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/users/') do |req|
req.body = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/users/";
let payload = json!({
"email": "",
"is_admin": false,
"name": "",
"title": ""
});
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}}/users/ \
--header 'content-type: application/json' \
--data '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
echo '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}' | \
http POST {{baseUrl}}/users/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "email": "",\n "is_admin": false,\n "name": "",\n "title": ""\n}' \
--output-document \
- {{baseUrl}}/users/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"email": "",
"is_admin": false,
"name": "",
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
}
DELETE
Deactivate a user
{{baseUrl}}/users/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/users/:id/")
require "http/client"
url = "{{baseUrl}}/users/:id/"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/users/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/users/:id/");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/users/:id/"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/users/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/users/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/users/:id/"))
.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}}/users/:id/")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/users/:id/")
.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}}/users/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/users/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/users/:id/';
const options = {method: 'DELETE'};
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}}/users/:id/',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/users/:id/")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/users/:id/',
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: 'DELETE', url: '{{baseUrl}}/users/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/users/:id/');
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}}/users/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/users/:id/';
const options = {method: 'DELETE'};
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}}/users/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/users/:id/" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/users/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/users/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/users/:id/');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/users/:id/');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:id/' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:id/' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/users/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/users/:id/"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/users/:id/"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/users/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/users/:id/') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/users/:id/";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/users/:id/
http DELETE {{baseUrl}}/users/:id/
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/users/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
List users
{{baseUrl}}/users/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/users/")
require "http/client"
url = "{{baseUrl}}/users/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/users/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/users/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/users/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/users/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/users/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/users/"))
.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}}/users/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/users/")
.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}}/users/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/users/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/users/';
const options = {method: 'GET'};
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}}/users/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/users/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/users/',
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: 'GET', url: '{{baseUrl}}/users/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/users/');
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}}/users/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/users/';
const options = {method: 'GET'};
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}}/users/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/users/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/users/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/users/');
echo $response->getBody();
setUrl('{{baseUrl}}/users/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/users/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/users/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/users/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/users/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/users/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/users/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/users/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/users/
http GET {{baseUrl}}/users/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/users/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PATCH
Partial update user
{{baseUrl}}/users/:id/
QUERY PARAMS
id
BODY json
{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:id/");
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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/users/:id/" {:content-type :json
:form-params {:email ""
:is_admin false
:name ""
:title ""}})
require "http/client"
url = "{{baseUrl}}/users/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/users/:id/"),
Content = new StringContent("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/:id/");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/users/:id/"
payload := strings.NewReader("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/users/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/users/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/users/:id/"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/users/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/users/:id/")
.header("content-type", "application/json")
.body("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
email: '',
is_admin: false,
name: '',
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/users/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/users/:id/',
headers: {'content-type': 'application/json'},
data: {email: '', is_admin: false, name: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/users/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"email":"","is_admin":false,"name":"","title":""}'
};
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}}/users/:id/',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "email": "",\n "is_admin": false,\n "name": "",\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/users/:id/")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/users/:id/',
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({email: '', is_admin: false, name: '', title: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/users/:id/',
headers: {'content-type': 'application/json'},
body: {email: '', is_admin: false, name: '', title: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/users/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
email: '',
is_admin: false,
name: '',
title: ''
});
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}}/users/:id/',
headers: {'content-type': 'application/json'},
data: {email: '', is_admin: false, name: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/users/:id/';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"email":"","is_admin":false,"name":"","title":""}'
};
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 = @{ @"email": @"",
@"is_admin": @NO,
@"name": @"",
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/users/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/users/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]),
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('PATCH', '{{baseUrl}}/users/:id/', [
'body' => '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/users/:id/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/users/:id/');
$request->setRequestMethod('PATCH');
$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}}/users/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:id/' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/users/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/users/:id/"
payload = {
"email": "",
"is_admin": False,
"name": "",
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/users/:id/"
payload <- "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/users/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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.patch('/baseUrl/users/:id/') do |req|
req.body = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/:id/";
let payload = json!({
"email": "",
"is_admin": false,
"name": "",
"title": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/users/:id/ \
--header 'content-type: application/json' \
--data '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
echo '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}' | \
http PATCH {{baseUrl}}/users/:id/ \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "email": "",\n "is_admin": false,\n "name": "",\n "title": ""\n}' \
--output-document \
- {{baseUrl}}/users/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"email": "",
"is_admin": false,
"name": "",
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve user
{{baseUrl}}/users/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/users/:id/")
require "http/client"
url = "{{baseUrl}}/users/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/users/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/users/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/users/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/users/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/users/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/users/:id/"))
.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}}/users/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/users/:id/")
.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}}/users/:id/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/users/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/users/:id/';
const options = {method: 'GET'};
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}}/users/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/users/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/users/:id/',
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: 'GET', url: '{{baseUrl}}/users/:id/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/users/:id/');
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}}/users/:id/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/users/:id/';
const options = {method: 'GET'};
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}}/users/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/users/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/users/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/users/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/users/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/users/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/users/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/users/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/users/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/users/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/users/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/users/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/users/:id/
http GET {{baseUrl}}/users/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/users/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
PUT
Update user
{{baseUrl}}/users/:id/
QUERY PARAMS
id
BODY json
{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:id/");
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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/users/:id/" {:content-type :json
:form-params {:email ""
:is_admin false
:name ""
:title ""}})
require "http/client"
url = "{{baseUrl}}/users/:id/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/:id/"),
Content = new StringContent("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/:id/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/users/:id/"
payload := strings.NewReader("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/users/:id/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/users/:id/")
.setHeader("content-type", "application/json")
.setBody("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/users/:id/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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 \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/users/:id/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/users/:id/")
.header("content-type", "application/json")
.body("{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
email: '',
is_admin: false,
name: '',
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/users/:id/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/users/:id/',
headers: {'content-type': 'application/json'},
data: {email: '', is_admin: false, name: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/users/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"email":"","is_admin":false,"name":"","title":""}'
};
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}}/users/:id/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "email": "",\n "is_admin": false,\n "name": "",\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/users/:id/")
.put(body)
.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/users/:id/',
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({email: '', is_admin: false, name: '', title: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/users/:id/',
headers: {'content-type': 'application/json'},
body: {email: '', is_admin: false, name: '', title: ''},
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}}/users/:id/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
email: '',
is_admin: false,
name: '',
title: ''
});
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}}/users/:id/',
headers: {'content-type': 'application/json'},
data: {email: '', is_admin: false, name: '', title: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/users/:id/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"email":"","is_admin":false,"name":"","title":""}'
};
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 = @{ @"email": @"",
@"is_admin": @NO,
@"name": @"",
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:id/"]
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}}/users/:id/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/users/:id/",
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([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]),
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('PUT', '{{baseUrl}}/users/:id/', [
'body' => '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/users/:id/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'email' => '',
'is_admin' => null,
'name' => '',
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/users/:id/');
$request->setRequestMethod('PUT');
$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}}/users/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:id/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/users/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/users/:id/"
payload = {
"email": "",
"is_admin": False,
"name": "",
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/users/:id/"
payload <- "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/users/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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/users/:id/') do |req|
req.body = "{\n \"email\": \"\",\n \"is_admin\": false,\n \"name\": \"\",\n \"title\": \"\"\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}}/users/:id/";
let payload = json!({
"email": "",
"is_admin": false,
"name": "",
"title": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/users/:id/ \
--header 'content-type: application/json' \
--data '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}'
echo '{
"email": "",
"is_admin": false,
"name": "",
"title": ""
}' | \
http PUT {{baseUrl}}/users/:id/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "email": "",\n "is_admin": false,\n "name": "",\n "title": ""\n}' \
--output-document \
- {{baseUrl}}/users/:id/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"email": "",
"is_admin": false,
"name": "",
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:id/")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
User data
{{baseUrl}}/profile/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/profile/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/profile/")
require "http/client"
url = "{{baseUrl}}/profile/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/profile/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/profile/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/profile/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/profile/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/profile/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/profile/"))
.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}}/profile/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/profile/")
.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}}/profile/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/profile/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/profile/';
const options = {method: 'GET'};
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}}/profile/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/profile/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/profile/',
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: 'GET', url: '{{baseUrl}}/profile/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/profile/');
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}}/profile/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/profile/';
const options = {method: 'GET'};
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}}/profile/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/profile/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/profile/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/profile/');
echo $response->getBody();
setUrl('{{baseUrl}}/profile/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/profile/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/profile/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/profile/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/profile/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/profile/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/profile/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/profile/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/profile/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/profile/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/profile/
http GET {{baseUrl}}/profile/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/profile/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/profile/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"changed_by": {
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
},
"email": "example@probely.com",
"id": "jMXUw-BE_2vd",
"name": "Henrique Cimento"
}
GET
List vulnerability definitions
{{baseUrl}}/vulnerability_definitions/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/vulnerability_definitions/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/vulnerability_definitions/")
require "http/client"
url = "{{baseUrl}}/vulnerability_definitions/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/vulnerability_definitions/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/vulnerability_definitions/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/vulnerability_definitions/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/vulnerability_definitions/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/vulnerability_definitions/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/vulnerability_definitions/"))
.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}}/vulnerability_definitions/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/vulnerability_definitions/")
.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}}/vulnerability_definitions/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/vulnerability_definitions/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/vulnerability_definitions/';
const options = {method: 'GET'};
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}}/vulnerability_definitions/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/vulnerability_definitions/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/vulnerability_definitions/',
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: 'GET', url: '{{baseUrl}}/vulnerability_definitions/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/vulnerability_definitions/');
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}}/vulnerability_definitions/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/vulnerability_definitions/';
const options = {method: 'GET'};
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}}/vulnerability_definitions/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/vulnerability_definitions/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/vulnerability_definitions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/vulnerability_definitions/');
echo $response->getBody();
setUrl('{{baseUrl}}/vulnerability_definitions/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/vulnerability_definitions/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/vulnerability_definitions/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/vulnerability_definitions/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/vulnerability_definitions/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/vulnerability_definitions/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/vulnerability_definitions/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/vulnerability_definitions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/vulnerability_definitions/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/vulnerability_definitions/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/vulnerability_definitions/
http GET {{baseUrl}}/vulnerability_definitions/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/vulnerability_definitions/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/vulnerability_definitions/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"count": 6,
"length": 10,
"page": 1,
"page_total": 1
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}
GET
Retrieve vulnerability definition
{{baseUrl}}/vulnerability_definitions/:id/
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/vulnerability_definitions/:id/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/vulnerability_definitions/:id/")
require "http/client"
url = "{{baseUrl}}/vulnerability_definitions/:id/"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/vulnerability_definitions/:id/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/vulnerability_definitions/:id/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/vulnerability_definitions/:id/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/vulnerability_definitions/:id/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/vulnerability_definitions/:id/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/vulnerability_definitions/:id/"))
.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}}/vulnerability_definitions/:id/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/vulnerability_definitions/:id/")
.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}}/vulnerability_definitions/:id/');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/vulnerability_definitions/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/vulnerability_definitions/:id/';
const options = {method: 'GET'};
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}}/vulnerability_definitions/:id/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/vulnerability_definitions/:id/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/vulnerability_definitions/:id/',
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: 'GET',
url: '{{baseUrl}}/vulnerability_definitions/:id/'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/vulnerability_definitions/:id/');
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}}/vulnerability_definitions/:id/'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/vulnerability_definitions/:id/';
const options = {method: 'GET'};
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}}/vulnerability_definitions/:id/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/vulnerability_definitions/:id/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/vulnerability_definitions/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/vulnerability_definitions/:id/');
echo $response->getBody();
setUrl('{{baseUrl}}/vulnerability_definitions/:id/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/vulnerability_definitions/:id/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/vulnerability_definitions/:id/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/vulnerability_definitions/:id/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/vulnerability_definitions/:id/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/vulnerability_definitions/:id/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/vulnerability_definitions/:id/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/vulnerability_definitions/:id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/vulnerability_definitions/:id/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/vulnerability_definitions/:id/";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/vulnerability_definitions/:id/
http GET {{baseUrl}}/vulnerability_definitions/:id/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/vulnerability_definitions/:id/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/vulnerability_definitions/:id/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"changed": "2018-01-31T16:32:17.238553Z",
"desc": "Object description",
"id": "jMXUw-BE_2vd",
"name": "Object name"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"detail": "Authentication credentials were not provided."
}