Docker VPS Manager API
POST
Create and start a new container
{{baseUrl}}/containers
BODY json
{
"image": "",
"name": "",
"ports": [],
"env": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/containers");
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 \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/containers" {:content-type :json
:form-params {:image "nginx:latest"
:name "web-server"
:ports ["80:80"]
:env ["NGINX_HOST=example.com"]}})
require "http/client"
url = "{{baseUrl}}/containers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\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}}/containers"),
Content = new StringContent("{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\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}}/containers");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers"
payload := strings.NewReader("{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\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/containers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 128
{
"image": "nginx:latest",
"name": "web-server",
"ports": [
"80:80"
],
"env": [
"NGINX_HOST=example.com"
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/containers")
.setHeader("content-type", "application/json")
.setBody("{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\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 \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/containers")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/containers")
.header("content-type", "application/json")
.body("{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}")
.asString();
const data = JSON.stringify({
image: 'nginx:latest',
name: 'web-server',
ports: [
'80:80'
],
env: [
'NGINX_HOST=example.com'
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/containers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/containers',
headers: {'content-type': 'application/json'},
data: {
image: 'nginx:latest',
name: 'web-server',
ports: ['80:80'],
env: ['NGINX_HOST=example.com']
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"image":"nginx:latest","name":"web-server","ports":["80:80"],"env":["NGINX_HOST=example.com"]}'
};
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}}/containers',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "image": "nginx:latest",\n "name": "web-server",\n "ports": [\n "80:80"\n ],\n "env": [\n "NGINX_HOST=example.com"\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 \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/containers")
.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/containers',
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({
image: 'nginx:latest',
name: 'web-server',
ports: ['80:80'],
env: ['NGINX_HOST=example.com']
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/containers',
headers: {'content-type': 'application/json'},
body: {
image: 'nginx:latest',
name: 'web-server',
ports: ['80:80'],
env: ['NGINX_HOST=example.com']
},
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}}/containers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
image: 'nginx:latest',
name: 'web-server',
ports: [
'80:80'
],
env: [
'NGINX_HOST=example.com'
]
});
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}}/containers',
headers: {'content-type': 'application/json'},
data: {
image: 'nginx:latest',
name: 'web-server',
ports: ['80:80'],
env: ['NGINX_HOST=example.com']
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"image":"nginx:latest","name":"web-server","ports":["80:80"],"env":["NGINX_HOST=example.com"]}'
};
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 = @{ @"image": @"nginx:latest",
@"name": @"web-server",
@"ports": @[ @"80:80" ],
@"env": @[ @"NGINX_HOST=example.com" ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/containers"]
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}}/containers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers",
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([
'image' => 'nginx:latest',
'name' => 'web-server',
'ports' => [
'80:80'
],
'env' => [
'NGINX_HOST=example.com'
]
]),
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}}/containers', [
'body' => '{
"image": "nginx:latest",
"name": "web-server",
"ports": [
"80:80"
],
"env": [
"NGINX_HOST=example.com"
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/containers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'image' => 'nginx:latest',
'name' => 'web-server',
'ports' => [
'80:80'
],
'env' => [
'NGINX_HOST=example.com'
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'image' => 'nginx:latest',
'name' => 'web-server',
'ports' => [
'80:80'
],
'env' => [
'NGINX_HOST=example.com'
]
]));
$request->setRequestUrl('{{baseUrl}}/containers');
$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}}/containers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"image": "nginx:latest",
"name": "web-server",
"ports": [
"80:80"
],
"env": [
"NGINX_HOST=example.com"
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"image": "nginx:latest",
"name": "web-server",
"ports": [
"80:80"
],
"env": [
"NGINX_HOST=example.com"
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/containers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers"
payload = {
"image": "nginx:latest",
"name": "web-server",
"ports": ["80:80"],
"env": ["NGINX_HOST=example.com"]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers"
payload <- "{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\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}}/containers")
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 \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\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/containers') do |req|
req.body = "{\n \"image\": \"nginx:latest\",\n \"name\": \"web-server\",\n \"ports\": [\n \"80:80\"\n ],\n \"env\": [\n \"NGINX_HOST=example.com\"\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/containers";
let payload = json!({
"image": "nginx:latest",
"name": "web-server",
"ports": ("80:80"),
"env": ("NGINX_HOST=example.com")
});
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}}/containers \
--header 'content-type: application/json' \
--data '{
"image": "nginx:latest",
"name": "web-server",
"ports": [
"80:80"
],
"env": [
"NGINX_HOST=example.com"
]
}'
echo '{
"image": "nginx:latest",
"name": "web-server",
"ports": [
"80:80"
],
"env": [
"NGINX_HOST=example.com"
]
}' | \
http POST {{baseUrl}}/containers \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "image": "nginx:latest",\n "name": "web-server",\n "ports": [\n "80:80"\n ],\n "env": [\n "NGINX_HOST=example.com"\n ]\n}' \
--output-document \
- {{baseUrl}}/containers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"image": "nginx:latest",
"name": "web-server",
"ports": ["80:80"],
"env": ["NGINX_HOST=example.com"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers")! 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
Execute a command in a container
{{baseUrl}}/containers/:id/exec
QUERY PARAMS
id
BODY json
{
"command": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/containers/:id/exec");
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 \"command\": \"ls -la /app\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/containers/:id/exec" {:content-type :json
:form-params {:command "ls -la /app"}})
require "http/client"
url = "{{baseUrl}}/containers/:id/exec"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"command\": \"ls -la /app\"\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}}/containers/:id/exec"),
Content = new StringContent("{\n \"command\": \"ls -la /app\"\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}}/containers/:id/exec");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"command\": \"ls -la /app\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers/:id/exec"
payload := strings.NewReader("{\n \"command\": \"ls -la /app\"\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/containers/:id/exec HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"command": "ls -la /app"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/containers/:id/exec")
.setHeader("content-type", "application/json")
.setBody("{\n \"command\": \"ls -la /app\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers/:id/exec"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"command\": \"ls -la /app\"\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 \"command\": \"ls -la /app\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/containers/:id/exec")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/containers/:id/exec")
.header("content-type", "application/json")
.body("{\n \"command\": \"ls -la /app\"\n}")
.asString();
const data = JSON.stringify({
command: 'ls -la /app'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/containers/:id/exec');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/containers/:id/exec',
headers: {'content-type': 'application/json'},
data: {command: 'ls -la /app'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers/:id/exec';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"command":"ls -la /app"}'
};
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}}/containers/:id/exec',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "command": "ls -la /app"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"command\": \"ls -la /app\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/containers/:id/exec")
.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/containers/:id/exec',
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({command: 'ls -la /app'}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/containers/:id/exec',
headers: {'content-type': 'application/json'},
body: {command: 'ls -la /app'},
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}}/containers/:id/exec');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
command: 'ls -la /app'
});
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}}/containers/:id/exec',
headers: {'content-type': 'application/json'},
data: {command: 'ls -la /app'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers/:id/exec';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"command":"ls -la /app"}'
};
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 = @{ @"command": @"ls -la /app" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/containers/:id/exec"]
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}}/containers/:id/exec" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"command\": \"ls -la /app\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers/:id/exec",
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([
'command' => 'ls -la /app'
]),
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}}/containers/:id/exec', [
'body' => '{
"command": "ls -la /app"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/containers/:id/exec');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'command' => 'ls -la /app'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'command' => 'ls -la /app'
]));
$request->setRequestUrl('{{baseUrl}}/containers/:id/exec');
$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}}/containers/:id/exec' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"command": "ls -la /app"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers/:id/exec' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"command": "ls -la /app"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"command\": \"ls -la /app\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/containers/:id/exec", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers/:id/exec"
payload = { "command": "ls -la /app" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers/:id/exec"
payload <- "{\n \"command\": \"ls -la /app\"\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}}/containers/:id/exec")
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 \"command\": \"ls -la /app\"\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/containers/:id/exec') do |req|
req.body = "{\n \"command\": \"ls -la /app\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/containers/:id/exec";
let payload = json!({"command": "ls -la /app"});
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}}/containers/:id/exec \
--header 'content-type: application/json' \
--data '{
"command": "ls -la /app"
}'
echo '{
"command": "ls -la /app"
}' | \
http POST {{baseUrl}}/containers/:id/exec \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "command": "ls -la /app"\n}' \
--output-document \
- {{baseUrl}}/containers/:id/exec
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["command": "ls -la /app"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers/:id/exec")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get container logs
{{baseUrl}}/containers/:id/logs
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/containers/:id/logs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/containers/:id/logs")
require "http/client"
url = "{{baseUrl}}/containers/:id/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}}/containers/:id/logs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/containers/:id/logs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers/:id/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/containers/:id/logs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/containers/:id/logs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers/:id/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}}/containers/:id/logs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/containers/:id/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}}/containers/:id/logs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/containers/:id/logs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers/:id/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}}/containers/:id/logs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/containers/:id/logs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/containers/:id/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}}/containers/:id/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}}/containers/:id/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}}/containers/:id/logs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers/:id/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}}/containers/:id/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}}/containers/:id/logs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers/:id/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}}/containers/:id/logs');
echo $response->getBody();
setUrl('{{baseUrl}}/containers/:id/logs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/containers/:id/logs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/containers/:id/logs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers/:id/logs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/containers/:id/logs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers/:id/logs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers/:id/logs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/containers/:id/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/containers/:id/logs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/containers/:id/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}}/containers/:id/logs
http GET {{baseUrl}}/containers/:id/logs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/containers/:id/logs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers/:id/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()
GET
List all containers
{{baseUrl}}/containers
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/containers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/containers")
require "http/client"
url = "{{baseUrl}}/containers"
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}}/containers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/containers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers"
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/containers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/containers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers"))
.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}}/containers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/containers")
.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}}/containers');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/containers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers';
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}}/containers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/containers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/containers',
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}}/containers'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/containers');
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}}/containers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers';
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}}/containers"]
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}}/containers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers",
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}}/containers');
echo $response->getBody();
setUrl('{{baseUrl}}/containers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/containers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/containers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/containers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/containers")
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/containers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/containers";
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}}/containers
http GET {{baseUrl}}/containers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/containers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers")! 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()
DELETE
Remove a container
{{baseUrl}}/containers/: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}}/containers/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/containers/:id")
require "http/client"
url = "{{baseUrl}}/containers/: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}}/containers/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/containers/:id");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers/: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/containers/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/containers/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers/: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}}/containers/:id")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/containers/: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}}/containers/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/containers/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers/: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}}/containers/:id',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/containers/: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/containers/: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}}/containers/: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}}/containers/: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}}/containers/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers/: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}}/containers/: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}}/containers/:id" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers/: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}}/containers/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/containers/:id');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/containers/:id');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/containers/:id' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers/:id' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/containers/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers/:id"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers/:id"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/containers/: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/containers/: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}}/containers/: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}}/containers/:id
http DELETE {{baseUrl}}/containers/:id
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/containers/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers/: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()
POST
Start a container
{{baseUrl}}/containers/:id/start
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/containers/:id/start");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/containers/:id/start")
require "http/client"
url = "{{baseUrl}}/containers/:id/start"
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}}/containers/:id/start"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/containers/:id/start");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers/:id/start"
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/containers/:id/start HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/containers/:id/start")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers/:id/start"))
.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}}/containers/:id/start")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/containers/:id/start")
.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}}/containers/:id/start');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/containers/:id/start'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers/:id/start';
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}}/containers/:id/start',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/containers/:id/start")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/containers/:id/start',
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}}/containers/:id/start'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/containers/:id/start');
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}}/containers/:id/start'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers/:id/start';
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}}/containers/:id/start"]
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}}/containers/:id/start" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers/:id/start",
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}}/containers/:id/start');
echo $response->getBody();
setUrl('{{baseUrl}}/containers/:id/start');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/containers/:id/start');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/containers/:id/start' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers/:id/start' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/containers/:id/start")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers/:id/start"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers/:id/start"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/containers/:id/start")
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/containers/:id/start') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/containers/:id/start";
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}}/containers/:id/start
http POST {{baseUrl}}/containers/:id/start
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/containers/:id/start
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers/:id/start")! 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
Stop a container
{{baseUrl}}/containers/:id/stop
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/containers/:id/stop");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/containers/:id/stop")
require "http/client"
url = "{{baseUrl}}/containers/:id/stop"
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}}/containers/:id/stop"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/containers/:id/stop");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/containers/:id/stop"
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/containers/:id/stop HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/containers/:id/stop")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/containers/:id/stop"))
.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}}/containers/:id/stop")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/containers/:id/stop")
.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}}/containers/:id/stop');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/containers/:id/stop'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/containers/:id/stop';
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}}/containers/:id/stop',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/containers/:id/stop")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/containers/:id/stop',
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}}/containers/:id/stop'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/containers/:id/stop');
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}}/containers/:id/stop'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/containers/:id/stop';
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}}/containers/:id/stop"]
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}}/containers/:id/stop" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/containers/:id/stop",
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}}/containers/:id/stop');
echo $response->getBody();
setUrl('{{baseUrl}}/containers/:id/stop');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/containers/:id/stop');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/containers/:id/stop' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/containers/:id/stop' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/containers/:id/stop")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/containers/:id/stop"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/containers/:id/stop"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/containers/:id/stop")
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/containers/:id/stop') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/containers/:id/stop";
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}}/containers/:id/stop
http POST {{baseUrl}}/containers/:id/stop
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/containers/:id/stop
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/containers/:id/stop")! 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()