POST createLogCollector
{{baseUrl}}/logs
BODY json

{
  "name": "",
  "os": "",
  "source": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logs");

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  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/logs" {:content-type :json
                                                 :form-params {:name ""
                                                               :os ""
                                                               :source ""}})
require "http/client"

url = "{{baseUrl}}/logs"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\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}}/logs"),
    Content = new StringContent("{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\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}}/logs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/logs"

	payload := strings.NewReader("{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\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/logs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 44

{
  "name": "",
  "os": "",
  "source": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/logs")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/logs"))
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/logs")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/logs")
  .header("content-type", "application/json")
  .body("{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  name: '',
  os: '',
  source: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/logs');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/logs',
  headers: {'content-type': 'application/json'},
  data: {name: '', os: '', source: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/logs';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"name":"","os":"","source":""}'
};

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}}/logs',
  method: 'POST',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "name": "",\n  "os": "",\n  "source": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/logs")
  .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/logs',
  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({name: '', os: '', source: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/logs',
  headers: {'content-type': 'application/json'},
  body: {name: '', os: '', source: ''},
  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}}/logs');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  name: '',
  os: '',
  source: ''
});

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}}/logs',
  headers: {'content-type': 'application/json'},
  data: {name: '', os: '', source: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/logs';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"name":"","os":"","source":""}'
};

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 = @{ @"name": @"",
                              @"os": @"",
                              @"source": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/logs"]
                                                       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}}/logs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/logs",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => '',
    'os' => '',
    'source' => ''
  ]),
  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}}/logs', [
  'body' => '{
  "name": "",
  "os": "",
  "source": ""
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/logs');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'name' => '',
  'os' => '',
  'source' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'name' => '',
  'os' => '',
  'source' => ''
]));
$request->setRequestUrl('{{baseUrl}}/logs');
$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}}/logs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "name": "",
  "os": "",
  "source": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "name": "",
  "os": "",
  "source": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/baseUrl/logs", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/logs"

payload = {
    "name": "",
    "os": "",
    "source": ""
}
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/logs"

payload <- "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\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}}/logs")

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  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\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/logs') do |req|
  req.body = "{\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/logs";

    let payload = json!({
        "name": "",
        "os": "",
        "source": ""
    });

    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}}/logs \
  --header 'content-type: application/json' \
  --data '{
  "name": "",
  "os": "",
  "source": ""
}'
echo '{
  "name": "",
  "os": "",
  "source": ""
}' |  \
  http POST {{baseUrl}}/logs \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'content-type: application/json' \
  --body-data '{\n  "name": "",\n  "os": "",\n  "source": ""\n}' \
  --output-document \
  - {{baseUrl}}/logs
import Foundation

let headers = ["content-type": "application/json"]
let parameters = [
  "name": "",
  "os": "",
  "source": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logs")! 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

{
  "msg": "Operation Successful",
  "timestamp": "2000-01-23T04:56:07.000Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}
DELETE deleteLogCollector
{{baseUrl}}/logs/:logId
QUERY PARAMS

logId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logs/:logId");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/delete "{{baseUrl}}/logs/:logId")
require "http/client"

url = "{{baseUrl}}/logs/:logId"

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}}/logs/:logId"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/logs/:logId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/logs/:logId"

	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/logs/:logId HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/logs/:logId")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/logs/:logId"))
    .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}}/logs/:logId")
  .delete(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/logs/:logId")
  .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}}/logs/:logId');

xhr.send(data);
import axios from 'axios';

const options = {method: 'DELETE', url: '{{baseUrl}}/logs/:logId'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/logs/:logId';
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}}/logs/:logId',
  method: 'DELETE',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/logs/:logId")
  .delete(null)
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/logs/:logId',
  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}}/logs/:logId'};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('DELETE', '{{baseUrl}}/logs/:logId');

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}}/logs/:logId'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/logs/:logId';
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}}/logs/:logId"]
                                                       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}}/logs/:logId" in

Client.call `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/logs/:logId",
  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}}/logs/:logId');

echo $response->getBody();
setUrl('{{baseUrl}}/logs/:logId');
$request->setMethod(HTTP_METH_DELETE);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/logs/:logId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/logs/:logId' -Method DELETE 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logs/:logId' -Method DELETE 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("DELETE", "/baseUrl/logs/:logId")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/logs/:logId"

response = requests.delete(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/logs/:logId"

response <- VERB("DELETE", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/logs/:logId")

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/logs/:logId') do |req|
end

puts response.status
puts response.body
use std::str::FromStr;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/logs/:logId";

    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}}/logs/:logId
http DELETE {{baseUrl}}/logs/:logId
wget --quiet \
  --method DELETE \
  --output-document \
  - {{baseUrl}}/logs/:logId
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logs/:logId")! 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

{
  "msg": "Operation Successful",
  "timestamp": "2000-01-23T04:56:07.000Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}
GET getLogCollector
{{baseUrl}}/logs/:logId
QUERY PARAMS

logId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logs/:logId");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/logs/:logId")
require "http/client"

url = "{{baseUrl}}/logs/:logId"

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}}/logs/:logId"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/logs/:logId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/logs/:logId"

	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/logs/:logId HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/logs/:logId")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/logs/:logId"))
    .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}}/logs/:logId")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/logs/:logId")
  .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}}/logs/:logId');

xhr.send(data);
import axios from 'axios';

const options = {method: 'GET', url: '{{baseUrl}}/logs/:logId'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/logs/:logId';
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}}/logs/:logId',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/logs/:logId")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/logs/:logId',
  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}}/logs/:logId'};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/logs/:logId');

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}}/logs/:logId'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/logs/:logId';
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}}/logs/:logId"]
                                                       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}}/logs/:logId" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/logs/:logId",
  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}}/logs/:logId');

echo $response->getBody();
setUrl('{{baseUrl}}/logs/:logId');
$request->setMethod(HTTP_METH_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/logs/:logId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/logs/:logId' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logs/:logId' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/logs/:logId")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/logs/:logId"

response = requests.get(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/logs/:logId"

response <- VERB("GET", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/logs/:logId")

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/logs/:logId') do |req|
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/logs/:logId";

    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}}/logs/:logId
http GET {{baseUrl}}/logs/:logId
wget --quiet \
  --method GET \
  --output-document \
  - {{baseUrl}}/logs/:logId
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logs/:logId")! 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": "string",
  "name": "System Log",
  "os": "linux",
  "source": "/var/log/syslog",
  "status": "active",
  "createdDate": "2019-08-24T00:00:00.000Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}
GET getLogCollectors
{{baseUrl}}/logs
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logs");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/logs")
require "http/client"

url = "{{baseUrl}}/logs"

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}}/logs"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/logs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/logs"

	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/logs HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/logs")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/logs"))
    .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}}/logs")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/logs")
  .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}}/logs');

xhr.send(data);
import axios from 'axios';

const options = {method: 'GET', url: '{{baseUrl}}/logs'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/logs';
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}}/logs',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/logs")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/logs',
  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}}/logs'};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/logs');

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}}/logs'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/logs';
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}}/logs"]
                                                       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}}/logs" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/logs",
  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}}/logs');

echo $response->getBody();
setUrl('{{baseUrl}}/logs');
$request->setMethod(HTTP_METH_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/logs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/logs' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logs' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/logs")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/logs"

response = requests.get(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/logs"

response <- VERB("GET", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/logs")

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/logs') do |req|
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/logs";

    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}}/logs
http GET {{baseUrl}}/logs
wget --quiet \
  --method GET \
  --output-document \
  - {{baseUrl}}/logs
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logs")! 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": "string",
    "name": "System Log",
    "os": "linux",
    "source": "/var/log/syslog",
    "status": "active",
    "createdDate": "2019-08-24T00:00:00.000Z"
  }
]
POST runLogCollectorAction
{{baseUrl}}/logs/:logId/action
QUERY PARAMS

logId
BODY json

{
  "action": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logs/:logId/action");

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  \"action\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/logs/:logId/action" {:content-type :json
                                                               :form-params {:action ""}})
require "http/client"

url = "{{baseUrl}}/logs/:logId/action"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"action\": \"\"\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}}/logs/:logId/action"),
    Content = new StringContent("{\n  \"action\": \"\"\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}}/logs/:logId/action");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/logs/:logId/action"

	payload := strings.NewReader("{\n  \"action\": \"\"\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/logs/:logId/action HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18

{
  "action": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/logs/:logId/action")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"action\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/logs/:logId/action"))
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"action\": \"\"\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  \"action\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/logs/:logId/action")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/logs/:logId/action")
  .header("content-type", "application/json")
  .body("{\n  \"action\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  action: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/logs/:logId/action');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/logs/:logId/action',
  headers: {'content-type': 'application/json'},
  data: {action: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/logs/:logId/action';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"action":""}'
};

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}}/logs/:logId/action',
  method: 'POST',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "action": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"action\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/logs/:logId/action")
  .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/logs/:logId/action',
  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({action: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/logs/:logId/action',
  headers: {'content-type': 'application/json'},
  body: {action: ''},
  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}}/logs/:logId/action');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  action: ''
});

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}}/logs/:logId/action',
  headers: {'content-type': 'application/json'},
  data: {action: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/logs/:logId/action';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"action":""}'
};

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 = @{ @"action": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/logs/:logId/action"]
                                                       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}}/logs/:logId/action" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"action\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/logs/:logId/action",
  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([
    'action' => ''
  ]),
  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}}/logs/:logId/action', [
  'body' => '{
  "action": ""
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/logs/:logId/action');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'action' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'action' => ''
]));
$request->setRequestUrl('{{baseUrl}}/logs/:logId/action');
$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}}/logs/:logId/action' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "action": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logs/:logId/action' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "action": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"action\": \"\"\n}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/baseUrl/logs/:logId/action", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/logs/:logId/action"

payload = { "action": "" }
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/logs/:logId/action"

payload <- "{\n  \"action\": \"\"\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}}/logs/:logId/action")

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  \"action\": \"\"\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/logs/:logId/action') do |req|
  req.body = "{\n  \"action\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/logs/:logId/action";

    let payload = json!({"action": ""});

    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}}/logs/:logId/action \
  --header 'content-type: application/json' \
  --data '{
  "action": ""
}'
echo '{
  "action": ""
}' |  \
  http POST {{baseUrl}}/logs/:logId/action \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'content-type: application/json' \
  --body-data '{\n  "action": ""\n}' \
  --output-document \
  - {{baseUrl}}/logs/:logId/action
import Foundation

let headers = ["content-type": "application/json"]
let parameters = ["action": ""] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logs/:logId/action")! 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

{
  "msg": "Operation Successful",
  "timestamp": "2000-01-23T04:56:07.000Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}
PUT updateLogCollector
{{baseUrl}}/logs/:logId
QUERY PARAMS

logId
BODY json

{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/logs/:logId");

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\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/put "{{baseUrl}}/logs/:logId" {:content-type :json
                                                       :form-params {:id 0
                                                                     :name ""
                                                                     :os ""
                                                                     :source ""
                                                                     :status ""
                                                                     :createdDate ""}})
require "http/client"

url = "{{baseUrl}}/logs/:logId"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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}}/logs/:logId"),
    Content = new StringContent("{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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}}/logs/:logId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/logs/:logId"

	payload := strings.NewReader("{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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/logs/:logId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 92

{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/logs/:logId")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/logs/:logId"))
    .header("content-type", "application/json")
    .method("PUT", HttpRequest.BodyPublishers.ofString("{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/logs/:logId")
  .put(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/logs/:logId")
  .header("content-type", "application/json")
  .body("{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  id: 0,
  name: '',
  os: '',
  source: '',
  status: '',
  createdDate: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('PUT', '{{baseUrl}}/logs/:logId');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/logs/:logId',
  headers: {'content-type': 'application/json'},
  data: {id: 0, name: '', os: '', source: '', status: '', createdDate: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/logs/:logId';
const options = {
  method: 'PUT',
  headers: {'content-type': 'application/json'},
  body: '{"id":0,"name":"","os":"","source":"","status":"","createdDate":""}'
};

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}}/logs/:logId',
  method: 'PUT',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "id": 0,\n  "name": "",\n  "os": "",\n  "source": "",\n  "status": "",\n  "createdDate": ""\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\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/logs/:logId")
  .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/logs/:logId',
  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: 0, name: '', os: '', source: '', status: '', createdDate: ''}));
req.end();
const request = require('request');

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/logs/:logId',
  headers: {'content-type': 'application/json'},
  body: {id: 0, name: '', os: '', source: '', status: '', createdDate: ''},
  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}}/logs/:logId');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  id: 0,
  name: '',
  os: '',
  source: '',
  status: '',
  createdDate: ''
});

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}}/logs/:logId',
  headers: {'content-type': 'application/json'},
  data: {id: 0, name: '', os: '', source: '', status: '', createdDate: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/logs/:logId';
const options = {
  method: 'PUT',
  headers: {'content-type': 'application/json'},
  body: '{"id":0,"name":"","os":"","source":"","status":"","createdDate":""}'
};

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": @0,
                              @"name": @"",
                              @"os": @"",
                              @"source": @"",
                              @"status": @"",
                              @"createdDate": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/logs/:logId"]
                                                       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}}/logs/:logId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}" in

Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/logs/:logId",
  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' => 0,
    'name' => '',
    'os' => '',
    'source' => '',
    'status' => '',
    'createdDate' => ''
  ]),
  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}}/logs/:logId', [
  'body' => '{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/logs/:logId');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'id' => 0,
  'name' => '',
  'os' => '',
  'source' => '',
  'status' => '',
  'createdDate' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'id' => 0,
  'name' => '',
  'os' => '',
  'source' => '',
  'status' => '',
  'createdDate' => ''
]));
$request->setRequestUrl('{{baseUrl}}/logs/:logId');
$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}}/logs/:logId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/logs/:logId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\n}"

headers = { 'content-type': "application/json" }

conn.request("PUT", "/baseUrl/logs/:logId", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/logs/:logId"

payload = {
    "id": 0,
    "name": "",
    "os": "",
    "source": "",
    "status": "",
    "createdDate": ""
}
headers = {"content-type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/logs/:logId"

payload <- "{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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}}/logs/:logId")

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\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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/logs/:logId') do |req|
  req.body = "{\n  \"id\": 0,\n  \"name\": \"\",\n  \"os\": \"\",\n  \"source\": \"\",\n  \"status\": \"\",\n  \"createdDate\": \"\"\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}}/logs/:logId";

    let payload = json!({
        "id": 0,
        "name": "",
        "os": "",
        "source": "",
        "status": "",
        "createdDate": ""
    });

    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}}/logs/:logId \
  --header 'content-type: application/json' \
  --data '{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}'
echo '{
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
}' |  \
  http PUT {{baseUrl}}/logs/:logId \
  content-type:application/json
wget --quiet \
  --method PUT \
  --header 'content-type: application/json' \
  --body-data '{\n  "id": 0,\n  "name": "",\n  "os": "",\n  "source": "",\n  "status": "",\n  "createdDate": ""\n}' \
  --output-document \
  - {{baseUrl}}/logs/:logId
import Foundation

let headers = ["content-type": "application/json"]
let parameters = [
  "id": 0,
  "name": "",
  "os": "",
  "source": "",
  "status": "",
  "createdDate": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/logs/:logId")! 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

{
  "msg": "Operation Successful",
  "timestamp": "2000-01-23T04:56:07.000Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "msg": "Operation Failed"
}