Platformatic DB
POST
Create applicationScaleConfig.
{{baseUrl}}/applicationScaleConfigs/
BODY json
{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applicationScaleConfigs/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/applicationScaleConfigs/" {:content-type :json
:form-params {:id ""
:applicationId ""
:minPods 0
:maxPods 0
:createdAt ""}})
require "http/client"
url = "{{baseUrl}}/applicationScaleConfigs/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/"),
Content = new StringContent("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applicationScaleConfigs/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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/applicationScaleConfigs/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/applicationScaleConfigs/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applicationScaleConfigs/"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/applicationScaleConfigs/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
applicationId: '',
minPods: 0,
maxPods: 0,
createdAt: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/applicationScaleConfigs/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/applicationScaleConfigs/',
headers: {'content-type': 'application/json'},
data: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applicationScaleConfigs/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","minPods":0,"maxPods":0,"createdAt":""}'
};
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}}/applicationScaleConfigs/',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "applicationId": "",\n "minPods": 0,\n "maxPods": 0,\n "createdAt": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/")
.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/applicationScaleConfigs/',
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: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/applicationScaleConfigs/',
headers: {'content-type': 'application/json'},
body: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''},
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}}/applicationScaleConfigs/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
applicationId: '',
minPods: 0,
maxPods: 0,
createdAt: ''
});
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}}/applicationScaleConfigs/',
headers: {'content-type': 'application/json'},
data: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applicationScaleConfigs/';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","minPods":0,"maxPods":0,"createdAt":""}'
};
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": @"",
@"applicationId": @"",
@"minPods": @0,
@"maxPods": @0,
@"createdAt": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/applicationScaleConfigs/"]
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}}/applicationScaleConfigs/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applicationScaleConfigs/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]),
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}}/applicationScaleConfigs/', [
'body' => '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/applicationScaleConfigs/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]));
$request->setRequestUrl('{{baseUrl}}/applicationScaleConfigs/');
$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}}/applicationScaleConfigs/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applicationScaleConfigs/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/applicationScaleConfigs/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applicationScaleConfigs/"
payload = {
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applicationScaleConfigs/"
payload <- "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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/applicationScaleConfigs/') do |req|
req.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/applicationScaleConfigs/";
let payload = json!({
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
});
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}}/applicationScaleConfigs/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
echo '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}' | \
http POST {{baseUrl}}/applicationScaleConfigs/ \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "applicationId": "",\n "minPods": 0,\n "maxPods": 0,\n "createdAt": ""\n}' \
--output-document \
- {{baseUrl}}/applicationScaleConfigs/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applicationScaleConfigs/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Delete applicationScaleConfigs.
{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/applicationScaleConfigs/:id")
require "http/client"
url = "{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/applicationScaleConfigs/:id");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applicationScaleConfigs/: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/applicationScaleConfigs/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/applicationScaleConfigs/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/applicationScaleConfigs/:id'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/: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/applicationScaleConfigs/: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}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/applicationScaleConfigs/:id');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/applicationScaleConfigs/:id');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/applicationScaleConfigs/:id' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applicationScaleConfigs/:id' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/applicationScaleConfigs/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applicationScaleConfigs/:id"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applicationScaleConfigs/:id"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/applicationScaleConfigs/: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/applicationScaleConfigs/: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}}/applicationScaleConfigs/: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}}/applicationScaleConfigs/:id
http DELETE {{baseUrl}}/applicationScaleConfigs/:id
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/applicationScaleConfigs/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applicationScaleConfigs/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get ApplicationScaleConfig by id.
{{baseUrl}}/applicationScaleConfigs/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applicationScaleConfigs/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/applicationScaleConfigs/:id")
require "http/client"
url = "{{baseUrl}}/applicationScaleConfigs/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/applicationScaleConfigs/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/applicationScaleConfigs/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applicationScaleConfigs/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/applicationScaleConfigs/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/applicationScaleConfigs/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applicationScaleConfigs/:id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/applicationScaleConfigs/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/applicationScaleConfigs/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/applicationScaleConfigs/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applicationScaleConfigs/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/applicationScaleConfigs/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/applicationScaleConfigs/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/applicationScaleConfigs/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/applicationScaleConfigs/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/applicationScaleConfigs/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applicationScaleConfigs/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/applicationScaleConfigs/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/applicationScaleConfigs/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applicationScaleConfigs/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/applicationScaleConfigs/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/applicationScaleConfigs/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/applicationScaleConfigs/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/applicationScaleConfigs/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applicationScaleConfigs/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/applicationScaleConfigs/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applicationScaleConfigs/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applicationScaleConfigs/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/applicationScaleConfigs/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/applicationScaleConfigs/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/applicationScaleConfigs/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/applicationScaleConfigs/:id
http GET {{baseUrl}}/applicationScaleConfigs/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/applicationScaleConfigs/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applicationScaleConfigs/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get applicationScaleConfigs.
{{baseUrl}}/applicationScaleConfigs/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applicationScaleConfigs/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/applicationScaleConfigs/")
require "http/client"
url = "{{baseUrl}}/applicationScaleConfigs/"
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}}/applicationScaleConfigs/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/applicationScaleConfigs/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applicationScaleConfigs/"
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/applicationScaleConfigs/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/applicationScaleConfigs/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applicationScaleConfigs/"))
.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}}/applicationScaleConfigs/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/applicationScaleConfigs/")
.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}}/applicationScaleConfigs/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/applicationScaleConfigs/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applicationScaleConfigs/';
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}}/applicationScaleConfigs/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/applicationScaleConfigs/',
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}}/applicationScaleConfigs/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/applicationScaleConfigs/');
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}}/applicationScaleConfigs/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applicationScaleConfigs/';
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}}/applicationScaleConfigs/"]
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}}/applicationScaleConfigs/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applicationScaleConfigs/",
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}}/applicationScaleConfigs/');
echo $response->getBody();
setUrl('{{baseUrl}}/applicationScaleConfigs/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/applicationScaleConfigs/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/applicationScaleConfigs/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applicationScaleConfigs/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/applicationScaleConfigs/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applicationScaleConfigs/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applicationScaleConfigs/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/applicationScaleConfigs/")
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/applicationScaleConfigs/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/applicationScaleConfigs/";
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}}/applicationScaleConfigs/
http GET {{baseUrl}}/applicationScaleConfigs/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/applicationScaleConfigs/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applicationScaleConfigs/")! 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()
PUT
Update applicationScaleConfig.
{{baseUrl}}/applicationScaleConfigs/:id
QUERY PARAMS
id
BODY json
{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applicationScaleConfigs/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/applicationScaleConfigs/:id" {:content-type :json
:form-params {:id ""
:applicationId ""
:minPods 0
:maxPods 0
:createdAt ""}})
require "http/client"
url = "{{baseUrl}}/applicationScaleConfigs/:id"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/:id"),
Content = new StringContent("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/:id");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applicationScaleConfigs/:id"
payload := strings.NewReader("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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/applicationScaleConfigs/:id HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/applicationScaleConfigs/:id")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applicationScaleConfigs/:id"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/:id")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/applicationScaleConfigs/:id")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
applicationId: '',
minPods: 0,
maxPods: 0,
createdAt: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/applicationScaleConfigs/:id');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/applicationScaleConfigs/:id',
headers: {'content-type': 'application/json'},
data: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applicationScaleConfigs/:id';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","minPods":0,"maxPods":0,"createdAt":""}'
};
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}}/applicationScaleConfigs/:id',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "applicationId": "",\n "minPods": 0,\n "maxPods": 0,\n "createdAt": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/:id")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/applicationScaleConfigs/:id',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/applicationScaleConfigs/:id',
headers: {'content-type': 'application/json'},
body: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''},
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}}/applicationScaleConfigs/:id');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
applicationId: '',
minPods: 0,
maxPods: 0,
createdAt: ''
});
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}}/applicationScaleConfigs/:id',
headers: {'content-type': 'application/json'},
data: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applicationScaleConfigs/:id';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","minPods":0,"maxPods":0,"createdAt":""}'
};
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": @"",
@"applicationId": @"",
@"minPods": @0,
@"maxPods": @0,
@"createdAt": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/applicationScaleConfigs/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/applicationScaleConfigs/:id" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applicationScaleConfigs/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]),
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}}/applicationScaleConfigs/:id', [
'body' => '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/applicationScaleConfigs/:id');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]));
$request->setRequestUrl('{{baseUrl}}/applicationScaleConfigs/:id');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/applicationScaleConfigs/:id' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applicationScaleConfigs/:id' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/applicationScaleConfigs/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applicationScaleConfigs/:id"
payload = {
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applicationScaleConfigs/:id"
payload <- "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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/applicationScaleConfigs/:id') do |req|
req.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/:id";
let payload = json!({
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
});
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}}/applicationScaleConfigs/:id \
--header 'content-type: application/json' \
--data '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
echo '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}' | \
http PUT {{baseUrl}}/applicationScaleConfigs/:id \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "applicationId": "",\n "minPods": 0,\n "maxPods": 0,\n "createdAt": ""\n}' \
--output-document \
- {{baseUrl}}/applicationScaleConfigs/:id
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applicationScaleConfigs/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update applicationScaleConfigs.
{{baseUrl}}/applicationScaleConfigs/
BODY json
{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applicationScaleConfigs/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/applicationScaleConfigs/" {:content-type :json
:form-params {:id ""
:applicationId ""
:minPods 0
:maxPods 0
:createdAt ""}})
require "http/client"
url = "{{baseUrl}}/applicationScaleConfigs/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/"),
Content = new StringContent("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applicationScaleConfigs/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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/applicationScaleConfigs/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 88
{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/applicationScaleConfigs/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applicationScaleConfigs/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/applicationScaleConfigs/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
applicationId: '',
minPods: 0,
maxPods: 0,
createdAt: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/applicationScaleConfigs/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/applicationScaleConfigs/',
headers: {'content-type': 'application/json'},
data: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applicationScaleConfigs/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","minPods":0,"maxPods":0,"createdAt":""}'
};
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}}/applicationScaleConfigs/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "applicationId": "",\n "minPods": 0,\n "maxPods": 0,\n "createdAt": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/applicationScaleConfigs/")
.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/applicationScaleConfigs/',
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: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/applicationScaleConfigs/',
headers: {'content-type': 'application/json'},
body: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''},
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}}/applicationScaleConfigs/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
applicationId: '',
minPods: 0,
maxPods: 0,
createdAt: ''
});
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}}/applicationScaleConfigs/',
headers: {'content-type': 'application/json'},
data: {id: '', applicationId: '', minPods: 0, maxPods: 0, createdAt: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applicationScaleConfigs/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","minPods":0,"maxPods":0,"createdAt":""}'
};
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": @"",
@"applicationId": @"",
@"minPods": @0,
@"maxPods": @0,
@"createdAt": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/applicationScaleConfigs/"]
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}}/applicationScaleConfigs/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applicationScaleConfigs/",
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' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]),
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}}/applicationScaleConfigs/', [
'body' => '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/applicationScaleConfigs/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'applicationId' => '',
'minPods' => 0,
'maxPods' => 0,
'createdAt' => ''
]));
$request->setRequestUrl('{{baseUrl}}/applicationScaleConfigs/');
$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}}/applicationScaleConfigs/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applicationScaleConfigs/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/applicationScaleConfigs/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applicationScaleConfigs/"
payload = {
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applicationScaleConfigs/"
payload <- "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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/applicationScaleConfigs/') do |req|
req.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"minPods\": 0,\n \"maxPods\": 0,\n \"createdAt\": \"\"\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}}/applicationScaleConfigs/";
let payload = json!({
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
});
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}}/applicationScaleConfigs/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}'
echo '{
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
}' | \
http PUT {{baseUrl}}/applicationScaleConfigs/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "applicationId": "",\n "minPods": 0,\n "maxPods": 0,\n "createdAt": ""\n}' \
--output-document \
- {{baseUrl}}/applicationScaleConfigs/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"applicationId": "",
"minPods": 0,
"maxPods": 0,
"createdAt": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applicationScaleConfigs/")! 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()
DELETE
Delete controllers.
{{baseUrl}}/controllers/: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}}/controllers/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/controllers/:id")
require "http/client"
url = "{{baseUrl}}/controllers/: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}}/controllers/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/controllers/:id");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/controllers/: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/controllers/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/controllers/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/controllers/: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}}/controllers/:id")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/controllers/: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}}/controllers/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/controllers/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/controllers/: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}}/controllers/:id',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/controllers/: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/controllers/: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}}/controllers/: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}}/controllers/: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}}/controllers/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/controllers/: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}}/controllers/: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}}/controllers/:id" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/controllers/: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}}/controllers/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/controllers/:id');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/controllers/:id');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/controllers/:id' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/controllers/:id' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/controllers/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/controllers/:id"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/controllers/:id"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/controllers/: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/controllers/: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}}/controllers/: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}}/controllers/:id
http DELETE {{baseUrl}}/controllers/:id
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/controllers/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/controllers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get Controller by id.
{{baseUrl}}/controllers/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/controllers/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/controllers/:id")
require "http/client"
url = "{{baseUrl}}/controllers/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/controllers/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/controllers/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/controllers/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/controllers/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/controllers/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/controllers/:id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/controllers/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/controllers/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/controllers/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/controllers/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/controllers/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/controllers/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/controllers/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/controllers/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/controllers/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/controllers/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/controllers/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/controllers/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/controllers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/controllers/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/controllers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/controllers/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/controllers/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/controllers/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/controllers/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/controllers/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/controllers/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/controllers/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/controllers/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/controllers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/controllers/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/controllers/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/controllers/:id
http GET {{baseUrl}}/controllers/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/controllers/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/controllers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
Get controllers.
{{baseUrl}}/controllers/
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/controllers/");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/controllers/")
require "http/client"
url = "{{baseUrl}}/controllers/"
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}}/controllers/"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/controllers/");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/controllers/"
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/controllers/ HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/controllers/")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/controllers/"))
.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}}/controllers/")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/controllers/")
.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}}/controllers/');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/controllers/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/controllers/';
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}}/controllers/',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/controllers/")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/controllers/',
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}}/controllers/'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/controllers/');
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}}/controllers/'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/controllers/';
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}}/controllers/"]
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}}/controllers/" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/controllers/",
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}}/controllers/');
echo $response->getBody();
setUrl('{{baseUrl}}/controllers/');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/controllers/');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/controllers/' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/controllers/' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/controllers/")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/controllers/"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/controllers/"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/controllers/")
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/controllers/') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/controllers/";
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}}/controllers/
http GET {{baseUrl}}/controllers/
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/controllers/
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/controllers/")! 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()
PUT
Update controller.
{{baseUrl}}/controllers/:id
QUERY PARAMS
id
BODY json
{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/controllers/:id");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/controllers/:id" {:content-type :json
:form-params {:id ""
:applicationId ""
:deploymentId ""
:namespace ""
:controllerId ""
:kind ""
:apiVersion ""
:replicas 0
:createdAt ""}})
require "http/client"
url = "{{baseUrl}}/controllers/:id"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/:id"),
Content = new StringContent("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/:id");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/controllers/:id"
payload := strings.NewReader("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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/controllers/:id HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 170
{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/controllers/:id")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/controllers/:id"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/controllers/:id")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/controllers/:id")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/controllers/:id');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/controllers/:id',
headers: {'content-type': 'application/json'},
data: {
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/controllers/:id';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","deploymentId":"","namespace":"","controllerId":"","kind":"","apiVersion":"","replicas":0,"createdAt":""}'
};
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}}/controllers/:id',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "applicationId": "",\n "deploymentId": "",\n "namespace": "",\n "controllerId": "",\n "kind": "",\n "apiVersion": "",\n "replicas": 0,\n "createdAt": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/controllers/:id")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/controllers/:id',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/controllers/:id',
headers: {'content-type': 'application/json'},
body: {
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
},
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}}/controllers/:id');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
});
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}}/controllers/:id',
headers: {'content-type': 'application/json'},
data: {
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/controllers/:id';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","deploymentId":"","namespace":"","controllerId":"","kind":"","apiVersion":"","replicas":0,"createdAt":""}'
};
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": @"",
@"applicationId": @"",
@"deploymentId": @"",
@"namespace": @"",
@"controllerId": @"",
@"kind": @"",
@"apiVersion": @"",
@"replicas": @0,
@"createdAt": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/controllers/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/controllers/:id" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/controllers/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'controllerId' => '',
'kind' => '',
'apiVersion' => '',
'replicas' => 0,
'createdAt' => ''
]),
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}}/controllers/:id', [
'body' => '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/controllers/:id');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'controllerId' => '',
'kind' => '',
'apiVersion' => '',
'replicas' => 0,
'createdAt' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'controllerId' => '',
'kind' => '',
'apiVersion' => '',
'replicas' => 0,
'createdAt' => ''
]));
$request->setRequestUrl('{{baseUrl}}/controllers/:id');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/controllers/:id' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/controllers/:id' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/controllers/:id", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/controllers/:id"
payload = {
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/controllers/:id"
payload <- "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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/controllers/:id') do |req|
req.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/:id";
let payload = json!({
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
});
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}}/controllers/:id \
--header 'content-type: application/json' \
--data '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}'
echo '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}' | \
http PUT {{baseUrl}}/controllers/:id \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "applicationId": "",\n "deploymentId": "",\n "namespace": "",\n "controllerId": "",\n "kind": "",\n "apiVersion": "",\n "replicas": 0,\n "createdAt": ""\n}' \
--output-document \
- {{baseUrl}}/controllers/:id
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/controllers/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
Update controllers.
{{baseUrl}}/controllers/
BODY json
{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/controllers/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/controllers/" {:content-type :json
:form-params {:id ""
:applicationId ""
:deploymentId ""
:namespace ""
:controllerId ""
:kind ""
:apiVersion ""
:replicas 0
:createdAt ""}})
require "http/client"
url = "{{baseUrl}}/controllers/"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/"),
Content = new StringContent("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/controllers/"
payload := strings.NewReader("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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/controllers/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 170
{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/controllers/")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/controllers/"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/controllers/")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/controllers/")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}")
.asString();
const data = JSON.stringify({
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/controllers/');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/controllers/',
headers: {'content-type': 'application/json'},
data: {
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/controllers/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","deploymentId":"","namespace":"","controllerId":"","kind":"","apiVersion":"","replicas":0,"createdAt":""}'
};
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}}/controllers/',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "applicationId": "",\n "deploymentId": "",\n "namespace": "",\n "controllerId": "",\n "kind": "",\n "apiVersion": "",\n "replicas": 0,\n "createdAt": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/controllers/")
.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/controllers/',
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: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/controllers/',
headers: {'content-type': 'application/json'},
body: {
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
},
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}}/controllers/');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
});
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}}/controllers/',
headers: {'content-type': 'application/json'},
data: {
id: '',
applicationId: '',
deploymentId: '',
namespace: '',
controllerId: '',
kind: '',
apiVersion: '',
replicas: 0,
createdAt: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/controllers/';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"id":"","applicationId":"","deploymentId":"","namespace":"","controllerId":"","kind":"","apiVersion":"","replicas":0,"createdAt":""}'
};
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": @"",
@"applicationId": @"",
@"deploymentId": @"",
@"namespace": @"",
@"controllerId": @"",
@"kind": @"",
@"apiVersion": @"",
@"replicas": @0,
@"createdAt": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/controllers/"]
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}}/controllers/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/controllers/",
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' => '',
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'controllerId' => '',
'kind' => '',
'apiVersion' => '',
'replicas' => 0,
'createdAt' => ''
]),
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}}/controllers/', [
'body' => '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/controllers/');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'controllerId' => '',
'kind' => '',
'apiVersion' => '',
'replicas' => 0,
'createdAt' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'controllerId' => '',
'kind' => '',
'apiVersion' => '',
'replicas' => 0,
'createdAt' => ''
]));
$request->setRequestUrl('{{baseUrl}}/controllers/');
$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}}/controllers/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/controllers/' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/controllers/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/controllers/"
payload = {
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/controllers/"
payload <- "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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/controllers/') do |req|
req.body = "{\n \"id\": \"\",\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"controllerId\": \"\",\n \"kind\": \"\",\n \"apiVersion\": \"\",\n \"replicas\": 0,\n \"createdAt\": \"\"\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}}/controllers/";
let payload = json!({
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
});
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}}/controllers/ \
--header 'content-type: application/json' \
--data '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}'
echo '{
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
}' | \
http PUT {{baseUrl}}/controllers/ \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "applicationId": "",\n "deploymentId": "",\n "namespace": "",\n "controllerId": "",\n "kind": "",\n "apiVersion": "",\n "replicas": 0,\n "createdAt": ""\n}' \
--output-document \
- {{baseUrl}}/controllers/
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"applicationId": "",
"deploymentId": "",
"namespace": "",
"controllerId": "",
"kind": "",
"apiVersion": "",
"replicas": 0,
"createdAt": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/controllers/")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
get -applications--applicationId-scale-configs
{{baseUrl}}/applications/:applicationId/scale-configs
QUERY PARAMS
applicationId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applications/:applicationId/scale-configs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/applications/:applicationId/scale-configs")
require "http/client"
url = "{{baseUrl}}/applications/:applicationId/scale-configs"
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}}/applications/:applicationId/scale-configs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/applications/:applicationId/scale-configs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applications/:applicationId/scale-configs"
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/applications/:applicationId/scale-configs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/applications/:applicationId/scale-configs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applications/:applicationId/scale-configs"))
.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}}/applications/:applicationId/scale-configs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/applications/:applicationId/scale-configs")
.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}}/applications/:applicationId/scale-configs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/applications/:applicationId/scale-configs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applications/:applicationId/scale-configs';
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}}/applications/:applicationId/scale-configs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/applications/:applicationId/scale-configs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/applications/:applicationId/scale-configs',
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}}/applications/:applicationId/scale-configs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/applications/:applicationId/scale-configs');
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}}/applications/:applicationId/scale-configs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applications/:applicationId/scale-configs';
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}}/applications/:applicationId/scale-configs"]
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}}/applications/:applicationId/scale-configs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applications/:applicationId/scale-configs",
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}}/applications/:applicationId/scale-configs');
echo $response->getBody();
setUrl('{{baseUrl}}/applications/:applicationId/scale-configs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/applications/:applicationId/scale-configs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/applications/:applicationId/scale-configs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applications/:applicationId/scale-configs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/applications/:applicationId/scale-configs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applications/:applicationId/scale-configs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applications/:applicationId/scale-configs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/applications/:applicationId/scale-configs")
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/applications/:applicationId/scale-configs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/applications/:applicationId/scale-configs";
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}}/applications/:applicationId/scale-configs
http GET {{baseUrl}}/applications/:applicationId/scale-configs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/applications/:applicationId/scale-configs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applications/:applicationId/scale-configs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
post -alerts
{{baseUrl}}/alerts
BODY json
{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/alerts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/alerts" {:content-type :json
:form-params {:id ""
:service ""
:currentHealth {:elu ""
:heapUsed ""
:heapTotal ""}
:unhealthy false
:healthConfig {:enabled false
:interval ""
:gracePeriod ""
:maxUnhealthyChecks ""
:maxELU ""
:maxHeapUsed ""
:maxHeapTotal ""}}})
require "http/client"
url = "{{baseUrl}}/alerts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\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}}/alerts"),
Content = new StringContent("{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\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}}/alerts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/alerts"
payload := strings.NewReader("{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\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/alerts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 318
{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/alerts")
.setHeader("content-type", "application/json")
.setBody("{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/alerts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/alerts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/alerts")
.header("content-type", "application/json")
.body("{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
id: '',
service: '',
currentHealth: {
elu: '',
heapUsed: '',
heapTotal: ''
},
unhealthy: false,
healthConfig: {
enabled: false,
interval: '',
gracePeriod: '',
maxUnhealthyChecks: '',
maxELU: '',
maxHeapUsed: '',
maxHeapTotal: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/alerts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/alerts',
headers: {'content-type': 'application/json'},
data: {
id: '',
service: '',
currentHealth: {elu: '', heapUsed: '', heapTotal: ''},
unhealthy: false,
healthConfig: {
enabled: false,
interval: '',
gracePeriod: '',
maxUnhealthyChecks: '',
maxELU: '',
maxHeapUsed: '',
maxHeapTotal: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/alerts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","service":"","currentHealth":{"elu":"","heapUsed":"","heapTotal":""},"unhealthy":false,"healthConfig":{"enabled":false,"interval":"","gracePeriod":"","maxUnhealthyChecks":"","maxELU":"","maxHeapUsed":"","maxHeapTotal":""}}'
};
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}}/alerts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "id": "",\n "service": "",\n "currentHealth": {\n "elu": "",\n "heapUsed": "",\n "heapTotal": ""\n },\n "unhealthy": false,\n "healthConfig": {\n "enabled": false,\n "interval": "",\n "gracePeriod": "",\n "maxUnhealthyChecks": "",\n "maxELU": "",\n "maxHeapUsed": "",\n "maxHeapTotal": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/alerts")
.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/alerts',
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: '',
service: '',
currentHealth: {elu: '', heapUsed: '', heapTotal: ''},
unhealthy: false,
healthConfig: {
enabled: false,
interval: '',
gracePeriod: '',
maxUnhealthyChecks: '',
maxELU: '',
maxHeapUsed: '',
maxHeapTotal: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/alerts',
headers: {'content-type': 'application/json'},
body: {
id: '',
service: '',
currentHealth: {elu: '', heapUsed: '', heapTotal: ''},
unhealthy: false,
healthConfig: {
enabled: false,
interval: '',
gracePeriod: '',
maxUnhealthyChecks: '',
maxELU: '',
maxHeapUsed: '',
maxHeapTotal: ''
}
},
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}}/alerts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
id: '',
service: '',
currentHealth: {
elu: '',
heapUsed: '',
heapTotal: ''
},
unhealthy: false,
healthConfig: {
enabled: false,
interval: '',
gracePeriod: '',
maxUnhealthyChecks: '',
maxELU: '',
maxHeapUsed: '',
maxHeapTotal: ''
}
});
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}}/alerts',
headers: {'content-type': 'application/json'},
data: {
id: '',
service: '',
currentHealth: {elu: '', heapUsed: '', heapTotal: ''},
unhealthy: false,
healthConfig: {
enabled: false,
interval: '',
gracePeriod: '',
maxUnhealthyChecks: '',
maxELU: '',
maxHeapUsed: '',
maxHeapTotal: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/alerts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"id":"","service":"","currentHealth":{"elu":"","heapUsed":"","heapTotal":""},"unhealthy":false,"healthConfig":{"enabled":false,"interval":"","gracePeriod":"","maxUnhealthyChecks":"","maxELU":"","maxHeapUsed":"","maxHeapTotal":""}}'
};
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": @"",
@"service": @"",
@"currentHealth": @{ @"elu": @"", @"heapUsed": @"", @"heapTotal": @"" },
@"unhealthy": @NO,
@"healthConfig": @{ @"enabled": @NO, @"interval": @"", @"gracePeriod": @"", @"maxUnhealthyChecks": @"", @"maxELU": @"", @"maxHeapUsed": @"", @"maxHeapTotal": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/alerts"]
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}}/alerts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/alerts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '',
'service' => '',
'currentHealth' => [
'elu' => '',
'heapUsed' => '',
'heapTotal' => ''
],
'unhealthy' => null,
'healthConfig' => [
'enabled' => null,
'interval' => '',
'gracePeriod' => '',
'maxUnhealthyChecks' => '',
'maxELU' => '',
'maxHeapUsed' => '',
'maxHeapTotal' => ''
]
]),
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}}/alerts', [
'body' => '{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/alerts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'id' => '',
'service' => '',
'currentHealth' => [
'elu' => '',
'heapUsed' => '',
'heapTotal' => ''
],
'unhealthy' => null,
'healthConfig' => [
'enabled' => null,
'interval' => '',
'gracePeriod' => '',
'maxUnhealthyChecks' => '',
'maxELU' => '',
'maxHeapUsed' => '',
'maxHeapTotal' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'id' => '',
'service' => '',
'currentHealth' => [
'elu' => '',
'heapUsed' => '',
'heapTotal' => ''
],
'unhealthy' => null,
'healthConfig' => [
'enabled' => null,
'interval' => '',
'gracePeriod' => '',
'maxUnhealthyChecks' => '',
'maxELU' => '',
'maxHeapUsed' => '',
'maxHeapTotal' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/alerts');
$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}}/alerts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/alerts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/alerts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/alerts"
payload = {
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": False,
"healthConfig": {
"enabled": False,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/alerts"
payload <- "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\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}}/alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\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/alerts') do |req|
req.body = "{\n \"id\": \"\",\n \"service\": \"\",\n \"currentHealth\": {\n \"elu\": \"\",\n \"heapUsed\": \"\",\n \"heapTotal\": \"\"\n },\n \"unhealthy\": false,\n \"healthConfig\": {\n \"enabled\": false,\n \"interval\": \"\",\n \"gracePeriod\": \"\",\n \"maxUnhealthyChecks\": \"\",\n \"maxELU\": \"\",\n \"maxHeapUsed\": \"\",\n \"maxHeapTotal\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/alerts";
let payload = json!({
"id": "",
"service": "",
"currentHealth": json!({
"elu": "",
"heapUsed": "",
"heapTotal": ""
}),
"unhealthy": false,
"healthConfig": json!({
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
})
});
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}}/alerts \
--header 'content-type: application/json' \
--data '{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}'
echo '{
"id": "",
"service": "",
"currentHealth": {
"elu": "",
"heapUsed": "",
"heapTotal": ""
},
"unhealthy": false,
"healthConfig": {
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
}
}' | \
http POST {{baseUrl}}/alerts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "id": "",\n "service": "",\n "currentHealth": {\n "elu": "",\n "heapUsed": "",\n "heapTotal": ""\n },\n "unhealthy": false,\n "healthConfig": {\n "enabled": false,\n "interval": "",\n "gracePeriod": "",\n "maxUnhealthyChecks": "",\n "maxELU": "",\n "maxHeapUsed": "",\n "maxHeapTotal": ""\n }\n}' \
--output-document \
- {{baseUrl}}/alerts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"id": "",
"service": "",
"currentHealth": [
"elu": "",
"heapUsed": "",
"heapTotal": ""
],
"unhealthy": false,
"healthConfig": [
"enabled": false,
"interval": "",
"gracePeriod": "",
"maxUnhealthyChecks": "",
"maxELU": "",
"maxHeapUsed": "",
"maxHeapTotal": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/alerts")! 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
post -applications--applicationId-scale-configs
{{baseUrl}}/applications/:applicationId/scale-configs
QUERY PARAMS
applicationId
BODY json
{
"minPods": 0,
"maxPods": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/applications/:applicationId/scale-configs");
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 \"minPods\": 0,\n \"maxPods\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/applications/:applicationId/scale-configs" {:content-type :json
:form-params {:minPods 0
:maxPods 0}})
require "http/client"
url = "{{baseUrl}}/applications/:applicationId/scale-configs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"minPods\": 0,\n \"maxPods\": 0\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}}/applications/:applicationId/scale-configs"),
Content = new StringContent("{\n \"minPods\": 0,\n \"maxPods\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/applications/:applicationId/scale-configs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"minPods\": 0,\n \"maxPods\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/applications/:applicationId/scale-configs"
payload := strings.NewReader("{\n \"minPods\": 0,\n \"maxPods\": 0\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/applications/:applicationId/scale-configs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 34
{
"minPods": 0,
"maxPods": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/applications/:applicationId/scale-configs")
.setHeader("content-type", "application/json")
.setBody("{\n \"minPods\": 0,\n \"maxPods\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/applications/:applicationId/scale-configs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"minPods\": 0,\n \"maxPods\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"minPods\": 0,\n \"maxPods\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/applications/:applicationId/scale-configs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/applications/:applicationId/scale-configs")
.header("content-type", "application/json")
.body("{\n \"minPods\": 0,\n \"maxPods\": 0\n}")
.asString();
const data = JSON.stringify({
minPods: 0,
maxPods: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/applications/:applicationId/scale-configs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/applications/:applicationId/scale-configs',
headers: {'content-type': 'application/json'},
data: {minPods: 0, maxPods: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/applications/:applicationId/scale-configs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"minPods":0,"maxPods":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/applications/:applicationId/scale-configs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "minPods": 0,\n "maxPods": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"minPods\": 0,\n \"maxPods\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/applications/:applicationId/scale-configs")
.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/applications/:applicationId/scale-configs',
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({minPods: 0, maxPods: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/applications/:applicationId/scale-configs',
headers: {'content-type': 'application/json'},
body: {minPods: 0, maxPods: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/applications/:applicationId/scale-configs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
minPods: 0,
maxPods: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/applications/:applicationId/scale-configs',
headers: {'content-type': 'application/json'},
data: {minPods: 0, maxPods: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/applications/:applicationId/scale-configs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"minPods":0,"maxPods":0}'
};
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 = @{ @"minPods": @0,
@"maxPods": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/applications/:applicationId/scale-configs"]
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}}/applications/:applicationId/scale-configs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"minPods\": 0,\n \"maxPods\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/applications/:applicationId/scale-configs",
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([
'minPods' => 0,
'maxPods' => 0
]),
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}}/applications/:applicationId/scale-configs', [
'body' => '{
"minPods": 0,
"maxPods": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/applications/:applicationId/scale-configs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'minPods' => 0,
'maxPods' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'minPods' => 0,
'maxPods' => 0
]));
$request->setRequestUrl('{{baseUrl}}/applications/:applicationId/scale-configs');
$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}}/applications/:applicationId/scale-configs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"minPods": 0,
"maxPods": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/applications/:applicationId/scale-configs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"minPods": 0,
"maxPods": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"minPods\": 0,\n \"maxPods\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/applications/:applicationId/scale-configs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/applications/:applicationId/scale-configs"
payload = {
"minPods": 0,
"maxPods": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/applications/:applicationId/scale-configs"
payload <- "{\n \"minPods\": 0,\n \"maxPods\": 0\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}}/applications/:applicationId/scale-configs")
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 \"minPods\": 0,\n \"maxPods\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/applications/:applicationId/scale-configs') do |req|
req.body = "{\n \"minPods\": 0,\n \"maxPods\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/applications/:applicationId/scale-configs";
let payload = json!({
"minPods": 0,
"maxPods": 0
});
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}}/applications/:applicationId/scale-configs \
--header 'content-type: application/json' \
--data '{
"minPods": 0,
"maxPods": 0
}'
echo '{
"minPods": 0,
"maxPods": 0
}' | \
http POST {{baseUrl}}/applications/:applicationId/scale-configs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "minPods": 0,\n "maxPods": 0\n}' \
--output-document \
- {{baseUrl}}/applications/:applicationId/scale-configs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"minPods": 0,
"maxPods": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/applications/:applicationId/scale-configs")! 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
savePodController
{{baseUrl}}/controllers
BODY json
{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/controllers");
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 \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/controllers" {:content-type :json
:form-params {:applicationId ""
:deploymentId ""
:namespace ""
:podId ""}})
require "http/client"
url = "{{baseUrl}}/controllers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\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}}/controllers"),
Content = new StringContent("{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\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}}/controllers");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/controllers"
payload := strings.NewReader("{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\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/controllers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 81
{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/controllers")
.setHeader("content-type", "application/json")
.setBody("{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/controllers"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\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 \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/controllers")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/controllers")
.header("content-type", "application/json")
.body("{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}")
.asString();
const data = JSON.stringify({
applicationId: '',
deploymentId: '',
namespace: '',
podId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/controllers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/controllers',
headers: {'content-type': 'application/json'},
data: {applicationId: '', deploymentId: '', namespace: '', podId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/controllers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"applicationId":"","deploymentId":"","namespace":"","podId":""}'
};
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}}/controllers',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "applicationId": "",\n "deploymentId": "",\n "namespace": "",\n "podId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/controllers")
.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/controllers',
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({applicationId: '', deploymentId: '', namespace: '', podId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/controllers',
headers: {'content-type': 'application/json'},
body: {applicationId: '', deploymentId: '', namespace: '', podId: ''},
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}}/controllers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
applicationId: '',
deploymentId: '',
namespace: '',
podId: ''
});
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}}/controllers',
headers: {'content-type': 'application/json'},
data: {applicationId: '', deploymentId: '', namespace: '', podId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/controllers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"applicationId":"","deploymentId":"","namespace":"","podId":""}'
};
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 = @{ @"applicationId": @"",
@"deploymentId": @"",
@"namespace": @"",
@"podId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/controllers"]
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}}/controllers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/controllers",
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([
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'podId' => ''
]),
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}}/controllers', [
'body' => '{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/controllers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'podId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'applicationId' => '',
'deploymentId' => '',
'namespace' => '',
'podId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/controllers');
$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}}/controllers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/controllers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/controllers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/controllers"
payload = {
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/controllers"
payload <- "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\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}}/controllers")
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 \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\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/controllers') do |req|
req.body = "{\n \"applicationId\": \"\",\n \"deploymentId\": \"\",\n \"namespace\": \"\",\n \"podId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/controllers";
let payload = json!({
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
});
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}}/controllers \
--header 'content-type: application/json' \
--data '{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}'
echo '{
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
}' | \
http POST {{baseUrl}}/controllers \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "applicationId": "",\n "deploymentId": "",\n "namespace": "",\n "podId": ""\n}' \
--output-document \
- {{baseUrl}}/controllers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"applicationId": "",
"deploymentId": "",
"namespace": "",
"podId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/controllers")! 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()