curl --request POST \
--url https://qstash-eu-central-1.upstash.io/v2/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"destination": "<string>",
"body": "<string>",
"headers": {},
"queue": "<string>"
}
]'
import requests
url = "https://qstash-eu-central-1.upstash.io/v2/batch"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
payload = [
{
"destination": "<string>",
"body": "<string>",
"headers": {},
"queue": "<string>"
}
]
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
const response = await fetch('https://qstash-eu-central-1.upstash.io/v2/batch', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
"destination": "<string>",
"body": "<string>",
"headers": {},
"queue": "<string>"
}
])
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://qstash-eu-central-1.upstash.io/v2/batch',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '[
{
"destination": "<string>",
"body": "<string>",
"headers": {},
"queue": "<string>"
}
]',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://qstash-eu-central-1.upstash.io/v2/batch"
payload := strings.NewReader("[\n {\n \"destination\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"queue\": \"<string>\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://qstash-eu-central-1.upstash.io/v2/batch"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("[\n {\n \"destination\": \"<string>\",\n \"body\": \"<string>\",\n \"headers\": {},\n \"queue\": \"<string>\"\n }\n]"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'uri'
require 'net/http'
url = URI('https://qstash-eu-central-1.upstash.io/v2/batch')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Post.new(url)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = '[
{
"destination": "<string>",
"body": "<string>",
"headers": {},
"queue": "<string>"
}
]'
response = http.request(request)
puts response.read_body