Warm-up endpoint for initialising WebClient
This is not an endpoint. This is the description of the request that is warming up the WebClient. It sends a lightweight JSON message to initialise network connections and reduce latency for subsequent API requests.
POST
/
warm-up
Warm-up endpoint for initialising WebClient
curl --request POST \
--url http://localhost/warm-up \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'X-WarmUp: <x-warmup>' \
--data '
{
"type": "WARM_UP",
"timestamp": "2021-09-01T12:00:00Z"
}
'import requests
url = "http://localhost/warm-up"
payload = {
"type": "WARM_UP",
"timestamp": "2021-09-01T12:00:00Z"
}
headers = {
"X-WarmUp": "<x-warmup>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-WarmUp': '<x-warmup>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({type: 'WARM_UP', timestamp: '2021-09-01T12:00:00Z'})
};
fetch('http://localhost/warm-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/warm-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'WARM_UP',
'timestamp' => '2021-09-01T12:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"X-WarmUp: <x-warmup>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/warm-up"
payload := strings.NewReader("{\n \"type\": \"WARM_UP\",\n \"timestamp\": \"2021-09-01T12:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-WarmUp", "<x-warmup>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost/warm-up")
.header("X-WarmUp", "<x-warmup>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"WARM_UP\",\n \"timestamp\": \"2021-09-01T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/warm-up")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-WarmUp"] = '<x-warmup>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"WARM_UP\",\n \"timestamp\": \"2021-09-01T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
Identifies the request as a warm-up call.
Example:
true
Body
application/json
The warm-up message payload
Response
200
Response will be ignored
Was this page helpful?
⌘I
Warm-up endpoint for initialising WebClient
curl --request POST \
--url http://localhost/warm-up \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'X-WarmUp: <x-warmup>' \
--data '
{
"type": "WARM_UP",
"timestamp": "2021-09-01T12:00:00Z"
}
'import requests
url = "http://localhost/warm-up"
payload = {
"type": "WARM_UP",
"timestamp": "2021-09-01T12:00:00Z"
}
headers = {
"X-WarmUp": "<x-warmup>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-WarmUp': '<x-warmup>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({type: 'WARM_UP', timestamp: '2021-09-01T12:00:00Z'})
};
fetch('http://localhost/warm-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/warm-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'WARM_UP',
'timestamp' => '2021-09-01T12:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"X-WarmUp: <x-warmup>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/warm-up"
payload := strings.NewReader("{\n \"type\": \"WARM_UP\",\n \"timestamp\": \"2021-09-01T12:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-WarmUp", "<x-warmup>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost/warm-up")
.header("X-WarmUp", "<x-warmup>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"WARM_UP\",\n \"timestamp\": \"2021-09-01T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/warm-up")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-WarmUp"] = '<x-warmup>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"WARM_UP\",\n \"timestamp\": \"2021-09-01T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body
