GraphHopper Directions API
POST
Batch Cluster Endpoint
{{baseUrl}}/cluster/calculate
BODY json
{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cluster/calculate");
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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cluster/calculate" {:content-type :json
:form-params {:configuration {:clustering {:max_quantity ""
:min_quantity ""
:num_clusters ""}
:response_type ""
:routing {:cost_per_meter ""
:cost_per_second ""
:profile ""}}
:customers [{:address {:lat ""
:lon ""
:street_hint ""}
:id ""
:quantity ""}]}})
require "http/client"
url = "{{baseUrl}}/cluster/calculate"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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}}/cluster/calculate"),
Content = new StringContent("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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}}/cluster/calculate");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cluster/calculate"
payload := strings.NewReader("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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/cluster/calculate HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 420
{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cluster/calculate")
.setHeader("content-type", "application/json")
.setBody("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cluster/calculate"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cluster/calculate")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cluster/calculate")
.header("content-type", "application/json")
.body("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
configuration: {
clustering: {
max_quantity: '',
min_quantity: '',
num_clusters: ''
},
response_type: '',
routing: {
cost_per_meter: '',
cost_per_second: '',
profile: ''
}
},
customers: [
{
address: {
lat: '',
lon: '',
street_hint: ''
},
id: '',
quantity: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cluster/calculate');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cluster/calculate',
headers: {'content-type': 'application/json'},
data: {
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cluster/calculate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"configuration":{"clustering":{"max_quantity":"","min_quantity":"","num_clusters":""},"response_type":"","routing":{"cost_per_meter":"","cost_per_second":"","profile":""}},"customers":[{"address":{"lat":"","lon":"","street_hint":""},"id":"","quantity":""}]}'
};
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}}/cluster/calculate',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "configuration": {\n "clustering": {\n "max_quantity": "",\n "min_quantity": "",\n "num_clusters": ""\n },\n "response_type": "",\n "routing": {\n "cost_per_meter": "",\n "cost_per_second": "",\n "profile": ""\n }\n },\n "customers": [\n {\n "address": {\n "lat": "",\n "lon": "",\n "street_hint": ""\n },\n "id": "",\n "quantity": ""\n }\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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cluster/calculate")
.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/cluster/calculate',
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({
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cluster/calculate',
headers: {'content-type': 'application/json'},
body: {
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
},
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}}/cluster/calculate');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
configuration: {
clustering: {
max_quantity: '',
min_quantity: '',
num_clusters: ''
},
response_type: '',
routing: {
cost_per_meter: '',
cost_per_second: '',
profile: ''
}
},
customers: [
{
address: {
lat: '',
lon: '',
street_hint: ''
},
id: '',
quantity: ''
}
]
});
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}}/cluster/calculate',
headers: {'content-type': 'application/json'},
data: {
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cluster/calculate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"configuration":{"clustering":{"max_quantity":"","min_quantity":"","num_clusters":""},"response_type":"","routing":{"cost_per_meter":"","cost_per_second":"","profile":""}},"customers":[{"address":{"lat":"","lon":"","street_hint":""},"id":"","quantity":""}]}'
};
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 = @{ @"configuration": @{ @"clustering": @{ @"max_quantity": @"", @"min_quantity": @"", @"num_clusters": @"" }, @"response_type": @"", @"routing": @{ @"cost_per_meter": @"", @"cost_per_second": @"", @"profile": @"" } },
@"customers": @[ @{ @"address": @{ @"lat": @"", @"lon": @"", @"street_hint": @"" }, @"id": @"", @"quantity": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cluster/calculate"]
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}}/cluster/calculate" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cluster/calculate",
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([
'configuration' => [
'clustering' => [
'max_quantity' => '',
'min_quantity' => '',
'num_clusters' => ''
],
'response_type' => '',
'routing' => [
'cost_per_meter' => '',
'cost_per_second' => '',
'profile' => ''
]
],
'customers' => [
[
'address' => [
'lat' => '',
'lon' => '',
'street_hint' => ''
],
'id' => '',
'quantity' => ''
]
]
]),
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}}/cluster/calculate', [
'body' => '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cluster/calculate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'configuration' => [
'clustering' => [
'max_quantity' => '',
'min_quantity' => '',
'num_clusters' => ''
],
'response_type' => '',
'routing' => [
'cost_per_meter' => '',
'cost_per_second' => '',
'profile' => ''
]
],
'customers' => [
[
'address' => [
'lat' => '',
'lon' => '',
'street_hint' => ''
],
'id' => '',
'quantity' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'configuration' => [
'clustering' => [
'max_quantity' => '',
'min_quantity' => '',
'num_clusters' => ''
],
'response_type' => '',
'routing' => [
'cost_per_meter' => '',
'cost_per_second' => '',
'profile' => ''
]
],
'customers' => [
[
'address' => [
'lat' => '',
'lon' => '',
'street_hint' => ''
],
'id' => '',
'quantity' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cluster/calculate');
$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}}/cluster/calculate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cluster/calculate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cluster/calculate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cluster/calculate"
payload = {
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cluster/calculate"
payload <- "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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}}/cluster/calculate")
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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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/cluster/calculate') do |req|
req.body = "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cluster/calculate";
let payload = json!({
"configuration": json!({
"clustering": json!({
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
}),
"response_type": "",
"routing": json!({
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
})
}),
"customers": (
json!({
"address": json!({
"lat": "",
"lon": "",
"street_hint": ""
}),
"id": "",
"quantity": ""
})
)
});
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}}/cluster/calculate \
--header 'content-type: application/json' \
--data '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}'
echo '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}' | \
http POST {{baseUrl}}/cluster/calculate \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "configuration": {\n "clustering": {\n "max_quantity": "",\n "min_quantity": "",\n "num_clusters": ""\n },\n "response_type": "",\n "routing": {\n "cost_per_meter": "",\n "cost_per_second": "",\n "profile": ""\n }\n },\n "customers": [\n {\n "address": {\n "lat": "",\n "lon": "",\n "street_hint": ""\n },\n "id": "",\n "quantity": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/cluster/calculate
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"configuration": [
"clustering": [
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
],
"response_type": "",
"routing": [
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
]
],
"customers": [
[
"address": [
"lat": "",
"lon": "",
"street_hint": ""
],
"id": "",
"quantity": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cluster/calculate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"job_id": "44886560-b584-4da5-b245-768151dacd8f"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Bad Request",
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"code": 500,
"message": "There has been an internal server error."
}
GET
GET Batch Solution Endpoint
{{baseUrl}}/cluster/solution/:jobId
QUERY PARAMS
jobId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cluster/solution/:jobId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cluster/solution/:jobId")
require "http/client"
url = "{{baseUrl}}/cluster/solution/:jobId"
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}}/cluster/solution/:jobId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cluster/solution/:jobId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cluster/solution/:jobId"
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/cluster/solution/:jobId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cluster/solution/:jobId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cluster/solution/:jobId"))
.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}}/cluster/solution/:jobId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cluster/solution/:jobId")
.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}}/cluster/solution/:jobId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/cluster/solution/:jobId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cluster/solution/:jobId';
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}}/cluster/solution/:jobId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cluster/solution/:jobId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cluster/solution/:jobId',
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}}/cluster/solution/:jobId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cluster/solution/:jobId');
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}}/cluster/solution/:jobId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cluster/solution/:jobId';
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}}/cluster/solution/:jobId"]
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}}/cluster/solution/:jobId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cluster/solution/:jobId",
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}}/cluster/solution/:jobId');
echo $response->getBody();
setUrl('{{baseUrl}}/cluster/solution/:jobId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cluster/solution/:jobId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cluster/solution/:jobId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cluster/solution/:jobId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/cluster/solution/:jobId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cluster/solution/:jobId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cluster/solution/:jobId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cluster/solution/:jobId")
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/cluster/solution/:jobId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cluster/solution/:jobId";
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}}/cluster/solution/:jobId
http GET {{baseUrl}}/cluster/solution/:jobId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/cluster/solution/:jobId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cluster/solution/:jobId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"processing_time": 4900,
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Bad Request",
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Invalid job_id 73314c89-ee4b-459c-aca4-0ad6d6e558da",
"status": "finished"
}
POST
POST Cluster Endpoint
{{baseUrl}}/cluster
BODY json
{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cluster");
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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cluster" {:content-type :json
:form-params {:configuration {:clustering {:max_quantity ""
:min_quantity ""
:num_clusters ""}
:response_type ""
:routing {:cost_per_meter ""
:cost_per_second ""
:profile ""}}
:customers [{:address {:lat ""
:lon ""
:street_hint ""}
:id ""
:quantity ""}]}})
require "http/client"
url = "{{baseUrl}}/cluster"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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}}/cluster"),
Content = new StringContent("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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}}/cluster");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cluster"
payload := strings.NewReader("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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/cluster HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 420
{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cluster")
.setHeader("content-type", "application/json")
.setBody("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cluster"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cluster")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cluster")
.header("content-type", "application/json")
.body("{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
configuration: {
clustering: {
max_quantity: '',
min_quantity: '',
num_clusters: ''
},
response_type: '',
routing: {
cost_per_meter: '',
cost_per_second: '',
profile: ''
}
},
customers: [
{
address: {
lat: '',
lon: '',
street_hint: ''
},
id: '',
quantity: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cluster');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cluster',
headers: {'content-type': 'application/json'},
data: {
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cluster';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"configuration":{"clustering":{"max_quantity":"","min_quantity":"","num_clusters":""},"response_type":"","routing":{"cost_per_meter":"","cost_per_second":"","profile":""}},"customers":[{"address":{"lat":"","lon":"","street_hint":""},"id":"","quantity":""}]}'
};
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}}/cluster',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "configuration": {\n "clustering": {\n "max_quantity": "",\n "min_quantity": "",\n "num_clusters": ""\n },\n "response_type": "",\n "routing": {\n "cost_per_meter": "",\n "cost_per_second": "",\n "profile": ""\n }\n },\n "customers": [\n {\n "address": {\n "lat": "",\n "lon": "",\n "street_hint": ""\n },\n "id": "",\n "quantity": ""\n }\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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cluster")
.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/cluster',
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({
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cluster',
headers: {'content-type': 'application/json'},
body: {
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
},
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}}/cluster');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
configuration: {
clustering: {
max_quantity: '',
min_quantity: '',
num_clusters: ''
},
response_type: '',
routing: {
cost_per_meter: '',
cost_per_second: '',
profile: ''
}
},
customers: [
{
address: {
lat: '',
lon: '',
street_hint: ''
},
id: '',
quantity: ''
}
]
});
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}}/cluster',
headers: {'content-type': 'application/json'},
data: {
configuration: {
clustering: {max_quantity: '', min_quantity: '', num_clusters: ''},
response_type: '',
routing: {cost_per_meter: '', cost_per_second: '', profile: ''}
},
customers: [{address: {lat: '', lon: '', street_hint: ''}, id: '', quantity: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cluster';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"configuration":{"clustering":{"max_quantity":"","min_quantity":"","num_clusters":""},"response_type":"","routing":{"cost_per_meter":"","cost_per_second":"","profile":""}},"customers":[{"address":{"lat":"","lon":"","street_hint":""},"id":"","quantity":""}]}'
};
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 = @{ @"configuration": @{ @"clustering": @{ @"max_quantity": @"", @"min_quantity": @"", @"num_clusters": @"" }, @"response_type": @"", @"routing": @{ @"cost_per_meter": @"", @"cost_per_second": @"", @"profile": @"" } },
@"customers": @[ @{ @"address": @{ @"lat": @"", @"lon": @"", @"street_hint": @"" }, @"id": @"", @"quantity": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cluster"]
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}}/cluster" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cluster",
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([
'configuration' => [
'clustering' => [
'max_quantity' => '',
'min_quantity' => '',
'num_clusters' => ''
],
'response_type' => '',
'routing' => [
'cost_per_meter' => '',
'cost_per_second' => '',
'profile' => ''
]
],
'customers' => [
[
'address' => [
'lat' => '',
'lon' => '',
'street_hint' => ''
],
'id' => '',
'quantity' => ''
]
]
]),
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}}/cluster', [
'body' => '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cluster');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'configuration' => [
'clustering' => [
'max_quantity' => '',
'min_quantity' => '',
'num_clusters' => ''
],
'response_type' => '',
'routing' => [
'cost_per_meter' => '',
'cost_per_second' => '',
'profile' => ''
]
],
'customers' => [
[
'address' => [
'lat' => '',
'lon' => '',
'street_hint' => ''
],
'id' => '',
'quantity' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'configuration' => [
'clustering' => [
'max_quantity' => '',
'min_quantity' => '',
'num_clusters' => ''
],
'response_type' => '',
'routing' => [
'cost_per_meter' => '',
'cost_per_second' => '',
'profile' => ''
]
],
'customers' => [
[
'address' => [
'lat' => '',
'lon' => '',
'street_hint' => ''
],
'id' => '',
'quantity' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/cluster');
$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}}/cluster' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cluster' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/cluster", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cluster"
payload = {
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cluster"
payload <- "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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}}/cluster")
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 \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\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/cluster') do |req|
req.body = "{\n \"configuration\": {\n \"clustering\": {\n \"max_quantity\": \"\",\n \"min_quantity\": \"\",\n \"num_clusters\": \"\"\n },\n \"response_type\": \"\",\n \"routing\": {\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"profile\": \"\"\n }\n },\n \"customers\": [\n {\n \"address\": {\n \"lat\": \"\",\n \"lon\": \"\",\n \"street_hint\": \"\"\n },\n \"id\": \"\",\n \"quantity\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cluster";
let payload = json!({
"configuration": json!({
"clustering": json!({
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
}),
"response_type": "",
"routing": json!({
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
})
}),
"customers": (
json!({
"address": json!({
"lat": "",
"lon": "",
"street_hint": ""
}),
"id": "",
"quantity": ""
})
)
});
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}}/cluster \
--header 'content-type: application/json' \
--data '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}'
echo '{
"configuration": {
"clustering": {
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
},
"response_type": "",
"routing": {
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
}
},
"customers": [
{
"address": {
"lat": "",
"lon": "",
"street_hint": ""
},
"id": "",
"quantity": ""
}
]
}' | \
http POST {{baseUrl}}/cluster \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "configuration": {\n "clustering": {\n "max_quantity": "",\n "min_quantity": "",\n "num_clusters": ""\n },\n "response_type": "",\n "routing": {\n "cost_per_meter": "",\n "cost_per_second": "",\n "profile": ""\n }\n },\n "customers": [\n {\n "address": {\n "lat": "",\n "lon": "",\n "street_hint": ""\n },\n "id": "",\n "quantity": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/cluster
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"configuration": [
"clustering": [
"max_quantity": "",
"min_quantity": "",
"num_clusters": ""
],
"response_type": "",
"routing": [
"cost_per_meter": "",
"cost_per_second": "",
"profile": ""
]
],
"customers": [
[
"address": [
"lat": "",
"lon": "",
"street_hint": ""
],
"id": "",
"quantity": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cluster")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"processing_time": 4900,
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Bad Request",
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"code": 500,
"message": "There has been an internal server error."
}
GET
Geocoding Endpoint
{{baseUrl}}/geocode
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/geocode");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/geocode")
require "http/client"
url = "{{baseUrl}}/geocode"
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}}/geocode"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/geocode");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/geocode"
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/geocode HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/geocode")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/geocode"))
.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}}/geocode")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/geocode")
.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}}/geocode');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/geocode'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/geocode';
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}}/geocode',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/geocode")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/geocode',
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}}/geocode'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/geocode');
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}}/geocode'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/geocode';
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}}/geocode"]
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}}/geocode" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/geocode",
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}}/geocode');
echo $response->getBody();
setUrl('{{baseUrl}}/geocode');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/geocode');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/geocode' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/geocode' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/geocode")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/geocode"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/geocode"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/geocode")
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/geocode') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/geocode";
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}}/geocode
http GET {{baseUrl}}/geocode
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/geocode
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/geocode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hits": [
{
"city": "Berlin",
"country": "Deutschland",
"name": "Berlin",
"osm_id": 240109189,
"osm_key": "place",
"osm_type": "N",
"osm_value": "city",
"point": {
"lat": 52.5170365,
"lng": 13.3888599
},
"postcode": "10117"
},
{
"country": "Deutschland",
"extent": [
13.088345,
52.6755087,
13.7611609,
52.33826
],
"name": "Berlin",
"osm_id": 62422,
"osm_key": "place",
"osm_type": "R",
"osm_value": "city",
"point": {
"lat": 52.5198535,
"lng": 13.4385964
}
},
{
"city": "Berlin",
"country": "Deutschland",
"extent": [
13.3906703,
52.5200704,
13.3948873,
52.5175007
],
"name": "Humboldt-Universität zu Berlin",
"osm_id": 120456814,
"osm_key": "amenity",
"osm_type": "W",
"osm_value": "university",
"point": {
"lat": 52.51875685,
"lng": 13.393560493637775
},
"postcode": "10117",
"street": "Dorotheenstraße"
},
{
"city": "Berlin",
"country": "Deutschland",
"extent": [
13.3924346,
52.5191829,
13.3948768,
52.517526
],
"housenumber": "6",
"name": "Humboldt-Universität zu Berlin",
"osm_id": 6647,
"osm_key": "building",
"osm_type": "R",
"osm_value": "yes",
"point": {
"lat": 52.51840935,
"lng": 13.392908021752554
},
"postcode": "10117",
"street": "Unter den Linden"
},
{
"city": "Berlin",
"country": "Deutschland",
"extent": [
13.2364563,
52.5161915,
13.2433375,
52.5129557
],
"housenumber": "3",
"name": "Olympiastadion Berlin",
"osm_id": 38862723,
"osm_key": "leisure",
"osm_type": "W",
"osm_value": "stadium",
"point": {
"lat": 52.5147077,
"lng": 13.239776301622072
},
"postcode": "14053",
"street": "Olympischer Platz"
},
{
"city": "Berlin",
"country": "Deutschland",
"extent": [
13.3739245,
52.528547,
13.3818019,
52.5229778
],
"name": "Charité Universitätsmedizin Berlin",
"osm_id": 583306346,
"osm_key": "amenity",
"osm_type": "W",
"osm_value": "hospital",
"point": {
"lat": 52.52585125,
"lng": 13.377739577932736
},
"postcode": "10117",
"street": "Hufelandweg"
},
{
"city": "Berlin",
"country": "Deutschland",
"extent": [
13.3906159,
52.5190301,
13.3923847,
52.5174089
],
"housenumber": "8",
"name": "Staatsbibliothek zu Berlin",
"osm_id": 180594,
"osm_key": "amenity",
"osm_type": "R",
"osm_value": "library",
"point": {
"lat": 52.5182233,
"lng": 13.391516532100738
},
"postcode": "10117",
"street": "Unter den Linden"
},
{
"city": "Berlin",
"country": "Deutschland",
"name": "Berlin Hauptbahnhof",
"osm_id": 3856100103,
"osm_key": "railway",
"osm_type": "N",
"osm_value": "station",
"point": {
"lat": 52.5249451,
"lng": 13.3696614
},
"postcode": "10557",
"street": "Washingtonplatz"
},
{
"city": "Berlin",
"country": "Deutschland",
"name": "Schlacht um Berlin",
"osm_id": 1078631331,
"osm_key": "historic",
"osm_type": "N",
"osm_value": "battlefield",
"point": {
"lat": 52.5127537,
"lng": 13.3814231
},
"postcode": "10117",
"street": "Gertrud-Kolmar-Straße"
},
{
"city": "Berlin",
"country": "Deutschland",
"extent": [
13.3807495,
52.5083344,
13.3822459,
52.5074359
],
"housenumber": "5",
"name": "Abgeordnetenhaus von Berlin",
"osm_id": 1154556,
"osm_key": "office",
"osm_type": "R",
"osm_value": "government",
"point": {
"lat": 52.50786655,
"lng": 13.381504320489928
},
"postcode": "10117",
"street": "Niederkirchnerstraße"
}
],
"took": 37
}
GET
Isochrone Endpoint
{{baseUrl}}/isochrone
QUERY PARAMS
point
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/isochrone?point=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/isochrone" {:query-params {:point ""}})
require "http/client"
url = "{{baseUrl}}/isochrone?point="
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}}/isochrone?point="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/isochrone?point=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/isochrone?point="
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/isochrone?point= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/isochrone?point=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/isochrone?point="))
.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}}/isochrone?point=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/isochrone?point=")
.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}}/isochrone?point=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/isochrone',
params: {point: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/isochrone?point=';
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}}/isochrone?point=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/isochrone?point=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/isochrone?point=',
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}}/isochrone', qs: {point: ''}};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/isochrone');
req.query({
point: ''
});
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}}/isochrone',
params: {point: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/isochrone?point=';
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}}/isochrone?point="]
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}}/isochrone?point=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/isochrone?point=",
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}}/isochrone?point=');
echo $response->getBody();
setUrl('{{baseUrl}}/isochrone');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'point' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/isochrone');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'point' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/isochrone?point=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/isochrone?point=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/isochrone?point=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/isochrone"
querystring = {"point":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/isochrone"
queryString <- list(point = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/isochrone?point=")
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/isochrone') do |req|
req.params['point'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/isochrone";
let querystring = [
("point", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/isochrone?point='
http GET '{{baseUrl}}/isochrone?point='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/isochrone?point='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/isochrone?point=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"polygons": [
{
"geometry": {
"coordinates": [
[
13.351851,
52.51345
],
[
13.350402,
52.516949
],
[
13.352598,
52.522252
],
[
13.351851,
52.51345
]
],
"type": "Polygon"
},
"properties": {
"bucket": 0
},
"type": "Feature"
}
]
}
POST
Map-match a GPX file
{{baseUrl}}/match
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/match");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/match")
require "http/client"
url = "{{baseUrl}}/match"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/match"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/match");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/match"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/match HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/match")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/match"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/match")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/match")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/match');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/match'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/match';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/match',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/match")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/match',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/match'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/match');
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}}/match'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/match';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/match"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/match" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/match",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/match');
echo $response->getBody();
setUrl('{{baseUrl}}/match');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/match');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/match' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/match' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/match")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/match"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/match"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/match")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/match') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/match";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/match
http POST {{baseUrl}}/match
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/match
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/match")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hints": {
"visited_nodes.average": 58,
"visited_nodes.sum": 58
},
"info": {
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"took": 2
},
"paths": [
{
"ascend": 6.3294677734375,
"bbox": [
11.539424,
48.118343,
11.558901,
48.122364
],
"descend": 25.0579833984375,
"details": {},
"distance": 1791.011,
"instructions": [
{
"distance": 672.954,
"heading": 89.04,
"interval": [
0,
6
],
"sign": 0,
"street_name": "Lindenschmitstraße",
"text": "Continue onto Lindenschmitstraße",
"time": 144703
},
{
"distance": 107.145,
"interval": [
6,
7
],
"sign": -2,
"street_name": "",
"text": "Turn left",
"time": 22675
},
{
"distance": 140.169,
"interval": [
7,
10
],
"sign": 2,
"street_name": "Oberländerstraße",
"text": "Turn right onto Oberländerstraße",
"time": 28032
},
{
"distance": 360.232,
"interval": [
10,
18
],
"sign": 1,
"street_name": "",
"text": "Turn slight right",
"time": 72677
},
{
"distance": 177.621,
"interval": [
18,
20
],
"sign": 2,
"street_name": "Thalkirchner Straße",
"text": "Turn right onto Thalkirchner Straße",
"time": 35524
},
{
"distance": 332.89,
"interval": [
20,
24
],
"sign": -2,
"street_name": "Thalkirchner Straße",
"text": "Turn left onto Thalkirchner Straße",
"time": 67351
},
{
"distance": 0,
"interval": [
24,
24
],
"last_heading": 45.67046584987792,
"sign": 4,
"street_name": "",
"text": "Arrive at destination",
"time": 0
}
],
"legs": [],
"points": {
"coordinates": [
[
11.539424,
48.118352
],
[
11.540387,
48.118368
],
[
11.54061,
48.118356
],
[
11.541941,
48.118409
],
[
11.543696,
48.118344
],
[
11.547167,
48.118343
],
[
11.548478,
48.118366
],
[
11.548487,
48.119329
],
[
11.548807,
48.119328
],
[
11.549408,
48.119366
],
[
11.550349,
48.119508
],
[
11.550441,
48.119473
],
[
11.551109,
48.119467
],
[
11.551553,
48.119445
],
[
11.551748,
48.119398
],
[
11.552087,
48.119475
],
[
11.552236,
48.119542
],
[
11.552353,
48.119635
],
[
11.553853,
48.121136
],
[
11.555448,
48.12039
],
[
11.555797,
48.120206
],
[
11.55632,
48.120592
],
[
11.556716,
48.120919
],
[
11.557326,
48.121345
],
[
11.558901,
48.122364
]
],
"type": "LineString"
},
"points_encoded": false,
"snapped_waypoints": {
"coordinates": [
[
11.539424,
48.118352
],
[
11.558901,
48.122364
]
],
"type": "LineString"
},
"time": 370962,
"transfers": 0,
"weight": 307.852443
}
]
}
POST
Batch Matrix Endpoint
{{baseUrl}}/matrix/calculate
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/matrix/calculate");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/matrix/calculate")
require "http/client"
url = "{{baseUrl}}/matrix/calculate"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/matrix/calculate"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/matrix/calculate");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/matrix/calculate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/matrix/calculate HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/matrix/calculate")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/matrix/calculate"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/matrix/calculate")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/matrix/calculate")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/matrix/calculate');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/matrix/calculate'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/matrix/calculate';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/matrix/calculate',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/matrix/calculate")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/matrix/calculate',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/matrix/calculate'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/matrix/calculate');
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}}/matrix/calculate'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/matrix/calculate';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/matrix/calculate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/matrix/calculate" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/matrix/calculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/matrix/calculate');
echo $response->getBody();
setUrl('{{baseUrl}}/matrix/calculate');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/matrix/calculate');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/matrix/calculate' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/matrix/calculate' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/matrix/calculate", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/matrix/calculate"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/matrix/calculate"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/matrix/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/matrix/calculate') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/matrix/calculate";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/matrix/calculate
http POST {{baseUrl}}/matrix/calculate
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/matrix/calculate
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/matrix/calculate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"job_id": "44886560-b584-4da5-b245-768151dacd8f"
}
GET
GET Batch Matrix Endpoint
{{baseUrl}}/matrix/solution/:jobId
QUERY PARAMS
jobId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/matrix/solution/:jobId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/matrix/solution/:jobId")
require "http/client"
url = "{{baseUrl}}/matrix/solution/:jobId"
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}}/matrix/solution/:jobId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/matrix/solution/:jobId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/matrix/solution/:jobId"
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/matrix/solution/:jobId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/matrix/solution/:jobId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/matrix/solution/:jobId"))
.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}}/matrix/solution/:jobId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/matrix/solution/:jobId")
.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}}/matrix/solution/:jobId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/matrix/solution/:jobId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/matrix/solution/:jobId';
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}}/matrix/solution/:jobId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/matrix/solution/:jobId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/matrix/solution/:jobId',
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}}/matrix/solution/:jobId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/matrix/solution/:jobId');
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}}/matrix/solution/:jobId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/matrix/solution/:jobId';
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}}/matrix/solution/:jobId"]
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}}/matrix/solution/:jobId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/matrix/solution/:jobId",
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}}/matrix/solution/:jobId');
echo $response->getBody();
setUrl('{{baseUrl}}/matrix/solution/:jobId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/matrix/solution/:jobId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/matrix/solution/:jobId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/matrix/solution/:jobId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/matrix/solution/:jobId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/matrix/solution/:jobId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/matrix/solution/:jobId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/matrix/solution/:jobId")
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/matrix/solution/:jobId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/matrix/solution/:jobId";
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}}/matrix/solution/:jobId
http GET {{baseUrl}}/matrix/solution/:jobId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/matrix/solution/:jobId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/matrix/solution/:jobId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"distances": [
[
0,
97653,
48887
],
[
97426,
0,
121035
],
[
49006,
121049,
0
]
],
"info": {
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
]
},
"times": [
[
0,
4197,
2994
],
[
4192,
0,
6074
],
[
3006,
6062,
0
]
],
"weights": [
[
0,
5662.551,
3727.147
],
[
5653.807,
0,
7889.653
],
[
3741.528,
7878.365,
0
]
]
}
GET
GET Matrix Endpoint
{{baseUrl}}/matrix
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/matrix");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/matrix")
require "http/client"
url = "{{baseUrl}}/matrix"
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}}/matrix"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/matrix");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/matrix"
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/matrix HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/matrix")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/matrix"))
.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}}/matrix")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/matrix")
.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}}/matrix');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/matrix'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/matrix';
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}}/matrix',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/matrix")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/matrix',
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}}/matrix'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/matrix');
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}}/matrix'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/matrix';
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}}/matrix"]
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}}/matrix" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/matrix",
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}}/matrix');
echo $response->getBody();
setUrl('{{baseUrl}}/matrix');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/matrix');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/matrix' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/matrix' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/matrix")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/matrix"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/matrix"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/matrix")
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/matrix') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/matrix";
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}}/matrix
http GET {{baseUrl}}/matrix
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/matrix
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/matrix")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"distances": [
[
0,
97653,
48887
],
[
97426,
0,
121035
],
[
49006,
121049,
0
]
],
"info": {
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
]
},
"times": [
[
0,
4197,
2994
],
[
4192,
0,
6074
],
[
3006,
6062,
0
]
],
"weights": [
[
0,
5662.551,
3727.147
],
[
5653.807,
0,
7889.653
],
[
3741.528,
7878.365,
0
]
]
}
POST
POST Matrix Endpoint
{{baseUrl}}/matrix
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/matrix");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/matrix")
require "http/client"
url = "{{baseUrl}}/matrix"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/matrix"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/matrix");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/matrix"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/matrix HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/matrix")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/matrix"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/matrix")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/matrix")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/matrix');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/matrix'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/matrix';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/matrix',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/matrix")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/matrix',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/matrix'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/matrix');
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}}/matrix'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/matrix';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/matrix"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/matrix" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/matrix",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/matrix');
echo $response->getBody();
setUrl('{{baseUrl}}/matrix');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/matrix');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/matrix' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/matrix' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/matrix", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/matrix"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/matrix"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/matrix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/matrix') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/matrix";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/matrix
http POST {{baseUrl}}/matrix
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/matrix
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/matrix")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"distances": [
[
0,
97653,
48887
],
[
97426,
0,
121035
],
[
49006,
121049,
0
]
],
"info": {
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
]
},
"times": [
[
0,
4197,
2994
],
[
4192,
0,
6074
],
[
3006,
6062,
0
]
],
"weights": [
[
0,
5662.551,
3727.147
],
[
5653.807,
0,
7889.653
],
[
3741.528,
7878.365,
0
]
]
}
GET
GET the solution (batch mode)
{{baseUrl}}/vrp/solution/:jobId
QUERY PARAMS
jobId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/vrp/solution/:jobId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/vrp/solution/:jobId")
require "http/client"
url = "{{baseUrl}}/vrp/solution/:jobId"
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}}/vrp/solution/:jobId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/vrp/solution/:jobId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/vrp/solution/:jobId"
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/vrp/solution/:jobId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/vrp/solution/:jobId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/vrp/solution/:jobId"))
.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}}/vrp/solution/:jobId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/vrp/solution/:jobId")
.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}}/vrp/solution/:jobId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/vrp/solution/:jobId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/vrp/solution/:jobId';
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}}/vrp/solution/:jobId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/vrp/solution/:jobId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/vrp/solution/:jobId',
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}}/vrp/solution/:jobId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/vrp/solution/:jobId');
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}}/vrp/solution/:jobId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/vrp/solution/:jobId';
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}}/vrp/solution/:jobId"]
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}}/vrp/solution/:jobId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/vrp/solution/:jobId",
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}}/vrp/solution/:jobId');
echo $response->getBody();
setUrl('{{baseUrl}}/vrp/solution/:jobId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/vrp/solution/:jobId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/vrp/solution/:jobId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/vrp/solution/:jobId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/vrp/solution/:jobId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/vrp/solution/:jobId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/vrp/solution/:jobId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/vrp/solution/:jobId")
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/vrp/solution/:jobId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/vrp/solution/:jobId";
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}}/vrp/solution/:jobId
http GET {{baseUrl}}/vrp/solution/:jobId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/vrp/solution/:jobId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/vrp/solution/:jobId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"job_id": "d62fcadd-c84a-4298-90b5-28550125bec5",
"processing_time": 459,
"solution": {
"completion_time": 4172,
"costs": 438,
"distance": 17994,
"max_operation_time": 2465,
"no_unassigned": 0,
"no_vehicles": 2,
"preparation_time": 0,
"routes": [
{
"activities": [
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"distance": 0,
"driving_time": 0,
"end_date_time": null,
"end_time": 1554804329,
"load_after": [
0
],
"location_id": "berlin",
"preparation_time": 0,
"type": "start",
"waiting_time": 0
},
{
"address": {
"lat": 52.529961,
"location_id": "13.387613_52.529961",
"lon": 13.387613
},
"arr_date_time": null,
"arr_time": 1554804789,
"distance": 2012,
"driving_time": 460,
"end_date_time": null,
"end_time": 1554804789,
"id": "7fe77504-7df8-4497-843c-02d70b6490ce",
"load_after": [
1
],
"load_before": [
0
],
"location_id": "13.387613_52.529961",
"preparation_time": 0,
"type": "pickupShipment",
"waiting_time": 0
},
{
"address": {
"lat": 52.513614,
"location_id": "13.380575_52.513614",
"lon": 13.380575
},
"arr_date_time": null,
"arr_time": 1554805344,
"distance": 4560,
"driving_time": 1015,
"end_date_time": null,
"end_time": 1554805344,
"id": "7fe77504-7df8-4497-843c-02d70b6490ce",
"load_after": [
0
],
"load_before": [
1
],
"location_id": "13.380575_52.513614",
"preparation_time": 0,
"type": "deliverShipment",
"waiting_time": 0
},
{
"address": {
"lat": 52.514038,
"location_id": "13.395767_52.514038",
"lon": 13.395767
},
"arr_date_time": null,
"arr_time": 1554805632,
"distance": 5887,
"driving_time": 1303,
"end_date_time": null,
"end_time": 1554805632,
"id": "s-4",
"load_after": [
1
],
"load_before": [
0
],
"location_id": "13.395767_52.514038",
"preparation_time": 0,
"type": "service",
"waiting_time": 0
},
{
"address": {
"lat": 52.523543,
"location_id": "13.416882_52.523543",
"lon": 13.416882
},
"arr_date_time": null,
"arr_time": 1554806253,
"distance": 8486,
"driving_time": 1924,
"end_date_time": null,
"end_time": 1554806253,
"id": "s-3",
"load_after": [
2
],
"load_before": [
1
],
"location_id": "13.416882_52.523543",
"preparation_time": 0,
"type": "service",
"waiting_time": 0
},
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"arr_date_time": null,
"arr_time": 1554806794,
"distance": 10618,
"driving_time": 2465,
"load_before": [
2
],
"location_id": "berlin",
"preparation_time": 0,
"type": "end",
"waiting_time": 0
}
],
"completion_time": 2465,
"distance": 10618,
"points": [
{
"coordinates": [
[
13.40608,
52.53701
],
[
13.40643,
52.53631
],
[
13.40554,
52.53616
],
[
13.4054,
52.53608
],
[
13.40445,
52.53513
],
[
13.40436,
52.53509
],
[
13.40428,
52.53508
],
[
13.40463,
52.53419
],
[
13.40451,
52.53419
],
[
13.4034,
52.53401
],
[
13.403,
52.53359
],
[
13.40291,
52.53354
],
[
13.40268,
52.53347
],
[
13.39888,
52.53259
],
[
13.39839,
52.53253
],
[
13.39812,
52.53251
],
[
13.39616,
52.53243
],
[
13.39579,
52.5324
],
[
13.38973,
52.53173
],
[
13.39163,
52.53025
],
[
13.38797,
52.52935
],
[
13.38763,
52.52996
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.38763,
52.52996
],
[
13.38739,
52.53039
],
[
13.38724,
52.53036
],
[
13.38464,
52.52929
],
[
13.38538,
52.52871
],
[
13.38634,
52.52792
],
[
13.38638,
52.52779
],
[
13.38657,
52.52763
],
[
13.38676,
52.52741
],
[
13.38698,
52.52713
],
[
13.38704,
52.52701
],
[
13.38753,
52.524
],
[
13.3877,
52.52307
],
[
13.3878,
52.52282
],
[
13.38788,
52.52252
],
[
13.38802,
52.52174
],
[
13.38519,
52.52009
],
[
13.38539,
52.5191
],
[
13.38548,
52.51852
],
[
13.38042,
52.51819
],
[
13.38071,
52.5167
],
[
13.38076,
52.51652
],
[
13.38084,
52.51634
],
[
13.3821,
52.51396
],
[
13.38055,
52.51365
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.38055,
52.51365
],
[
13.38229,
52.514
],
[
13.38363,
52.51429
],
[
13.3848,
52.51445
],
[
13.38504,
52.51358
],
[
13.39124,
52.51397
],
[
13.3911,
52.51488
],
[
13.39303,
52.51499
],
[
13.39317,
52.5141
],
[
13.39548,
52.51419
],
[
13.39571,
52.51421
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.39571,
52.51421
],
[
13.39695,
52.51434
],
[
13.39674,
52.51523
],
[
13.39742,
52.51531
],
[
13.39873,
52.51558
],
[
13.39846,
52.51599
],
[
13.39825,
52.51729
],
[
13.39805,
52.51755
],
[
13.39892,
52.51761
],
[
13.39917,
52.51764
],
[
13.39964,
52.51775
],
[
13.40009,
52.51791
],
[
13.40034,
52.51797
],
[
13.4021,
52.51864
],
[
13.40288,
52.51896
],
[
13.40375,
52.51936
],
[
13.40498,
52.52001
],
[
13.40463,
52.5203
],
[
13.40311,
52.52144
],
[
13.40442,
52.52189
],
[
13.40448,
52.52192
],
[
13.40451,
52.52195
],
[
13.40473,
52.52199
],
[
13.40504,
52.52208
],
[
13.40572,
52.52235
],
[
13.40687,
52.52294
],
[
13.40693,
52.52299
],
[
13.40706,
52.52319
],
[
13.40738,
52.52378
],
[
13.40787,
52.52443
],
[
13.4079,
52.52453
],
[
13.40938,
52.52401
],
[
13.40962,
52.52398
],
[
13.41001,
52.52395
],
[
13.41072,
52.52391
],
[
13.41215,
52.52389
],
[
13.41233,
52.52386
],
[
13.4131,
52.5235
],
[
13.41288,
52.52333
],
[
13.41475,
52.52247
],
[
13.41496,
52.52264
],
[
13.41523,
52.52251
],
[
13.41633,
52.52338
],
[
13.41631,
52.52346
],
[
13.41654,
52.52364
],
[
13.41684,
52.52351
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.41684,
52.52351
],
[
13.41654,
52.52364
],
[
13.41631,
52.52346
],
[
13.4163,
52.52344
],
[
13.41587,
52.52363
],
[
13.41572,
52.5235
],
[
13.41409,
52.5242
],
[
13.41454,
52.52461
],
[
13.41454,
52.52466
],
[
13.41358,
52.52508
],
[
13.41366,
52.52514
],
[
13.41344,
52.52525
],
[
13.4133,
52.52514
],
[
13.41316,
52.5252
],
[
13.41107,
52.52585
],
[
13.41118,
52.52606
],
[
13.41118,
52.52616
],
[
13.41095,
52.52664
],
[
13.41097,
52.52678
],
[
13.41084,
52.52706
],
[
13.41057,
52.52747
],
[
13.41028,
52.52809
],
[
13.41032,
52.52821
],
[
13.4102,
52.52847
],
[
13.40999,
52.52875
],
[
13.40984,
52.52905
],
[
13.40982,
52.52914
],
[
13.40984,
52.52926
],
[
13.4104,
52.52998
],
[
13.4105,
52.53001
],
[
13.41064,
52.53016
],
[
13.41082,
52.5303
],
[
13.41198,
52.53107
],
[
13.4122,
52.53128
],
[
13.41232,
52.53143
],
[
13.41247,
52.53192
],
[
13.41267,
52.53245
],
[
13.41275,
52.53259
],
[
13.41215,
52.5327
],
[
13.40731,
52.53463
],
[
13.40608,
52.53701
]
],
"type": "LineString"
}
],
"preparation_time": 0,
"service_duration": 0,
"transport_time": 2465,
"vehicle_id": "vehicle-2",
"waiting_time": 0
},
{
"activities": [
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"distance": 0,
"driving_time": 0,
"end_date_time": null,
"end_time": 1554804329,
"load_after": [
0
],
"location_id": "berlin",
"preparation_time": 0,
"type": "start",
"waiting_time": 0
},
{
"address": {
"lat": 52.525851,
"location_id": "13.393364_52.525851",
"lon": 13.393364
},
"arr_date_time": null,
"arr_time": 1554804743,
"distance": 1884,
"driving_time": 414,
"end_date_time": null,
"end_time": 1554804743,
"id": "s-2",
"load_after": [
1
],
"load_before": [
0
],
"location_id": "13.393364_52.525851",
"preparation_time": 0,
"type": "service",
"waiting_time": 0
},
{
"address": {
"lat": 52.537338,
"location_id": "13.375854_52.537338",
"lon": 13.375854
},
"arr_date_time": null,
"arr_time": 1554805251,
"distance": 4205,
"driving_time": 922,
"end_date_time": null,
"end_time": 1554805329,
"id": "s-1",
"load_after": [
2
],
"load_before": [
1
],
"location_id": "13.375854_52.537338",
"preparation_time": 0,
"type": "service",
"waiting_time": 78
},
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"arr_date_time": null,
"arr_time": 1554806036,
"distance": 7376,
"driving_time": 1629,
"load_before": [
2
],
"location_id": "berlin",
"preparation_time": 0,
"type": "end",
"waiting_time": 0
}
],
"completion_time": 1707,
"distance": 7376,
"points": [
{
"coordinates": [
[
13.40608,
52.53701
],
[
13.40674,
52.53571
],
[
13.40433,
52.53313
],
[
13.40271,
52.53149
],
[
13.40246,
52.53121
],
[
13.40148,
52.52999
],
[
13.40128,
52.52993
],
[
13.40118,
52.52988
],
[
13.40133,
52.5296
],
[
13.40138,
52.52951
],
[
13.40167,
52.52914
],
[
13.40188,
52.52895
],
[
13.398,
52.52885
],
[
13.39289,
52.52748
],
[
13.39354,
52.5264
],
[
13.39358,
52.52628
],
[
13.39324,
52.52575
],
[
13.39334,
52.52573
],
[
13.39339,
52.52584
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.39339,
52.52584
],
[
13.3934,
52.52599
],
[
13.39358,
52.52628
],
[
13.39354,
52.5264
],
[
13.39242,
52.52823
],
[
13.39381,
52.52852
],
[
13.38973,
52.53173
],
[
13.38717,
52.5315
],
[
13.38678,
52.5315
],
[
13.38641,
52.53147
],
[
13.38617,
52.53143
],
[
13.38607,
52.53155
],
[
13.38526,
52.53225
],
[
13.38501,
52.53252
],
[
13.38316,
52.53418
],
[
13.38179,
52.5355
],
[
13.38084,
52.53523
],
[
13.38081,
52.53531
],
[
13.3795,
52.53677
],
[
13.37941,
52.53682
],
[
13.37935,
52.53683
],
[
13.37919,
52.53682
],
[
13.37617,
52.5361
],
[
13.37502,
52.53698
],
[
13.37584,
52.53734
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.37584,
52.53734
],
[
13.37566,
52.53726
],
[
13.37515,
52.53763
],
[
13.37644,
52.53841
],
[
13.37807,
52.53935
],
[
13.37946,
52.5402
],
[
13.3796,
52.54019
],
[
13.37984,
52.54021
],
[
13.37988,
52.54012
],
[
13.38062,
52.53936
],
[
13.38169,
52.53832
],
[
13.38236,
52.5377
],
[
13.38363,
52.53661
],
[
13.38492,
52.53555
],
[
13.38613,
52.53447
],
[
13.38757,
52.53338
],
[
13.38791,
52.53354
],
[
13.38812,
52.53368
],
[
13.38833,
52.53392
],
[
13.38977,
52.53518
],
[
13.39003,
52.53539
],
[
13.39256,
52.53701
],
[
13.39316,
52.53739
],
[
13.39327,
52.53744
],
[
13.3936,
52.53757
],
[
13.40155,
52.53982
],
[
13.40357,
52.53715
],
[
13.40372,
52.53719
],
[
13.40465,
52.53727
],
[
13.4048,
52.53726
],
[
13.4059,
52.53736
],
[
13.40608,
52.53701
]
],
"type": "LineString"
}
],
"preparation_time": 0,
"service_duration": 0,
"transport_time": 1629,
"vehicle_id": "vehicle-1",
"waiting_time": 78
}
],
"service_duration": 0,
"time": 4094,
"transport_time": 4094,
"unassigned": {
"breaks": [],
"details": [],
"services": [],
"shipments": []
},
"waiting_time": 78
},
"status": "finished",
"waiting_time_in_queue": 0
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Bad Request",
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Invalid job_id 73314c89-ee4b-459c-aca4-0ad6d6e558da",
"status": "finished"
}
POST
POST route optimization problem (batch mode)
{{baseUrl}}/vrp/optimize
BODY json
{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/vrp/optimize");
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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/vrp/optimize" {:content-type :json
:form-params {:algorithm {:objective ""
:problem_type ""}
:configuration {:routing {:calc_points false
:consider_traffic false
:curbside_strictness ""
:fail_fast false
:network_data_provider ""
:return_snapped_waypoints false
:snap_preventions []}}
:cost_matrices [{:data {:distances []
:info {:copyrights []
:took ""}
:times []}
:location_ids []
:profile ""
:type ""}]
:objectives [{:type ""
:value ""}]
:relations []
:services [{:address {:curbside ""
:lat ""
:location_id ""
:lon ""
:name ""
:street_hint ""}
:allowed_vehicles []
:disallowed_vehicles []
:duration 0
:group ""
:id ""
:max_time_in_vehicle 0
:name ""
:preparation_time 0
:priority 0
:required_skills []
:size []
:time_windows [{:earliest 0
:latest 0}]
:type ""}]
:shipments [{:allowed_vehicles []
:delivery {:address {}
:duration 0
:group ""
:preparation_time 0
:time_windows [{}]}
:disallowed_vehicles []
:id ""
:max_time_in_vehicle 0
:name ""
:pickup {}
:priority 0
:required_skills []
:size []}]
:vehicle_types [{:capacity []
:consider_traffic false
:cost_per_activation ""
:cost_per_meter ""
:cost_per_second ""
:network_data_provider ""
:profile ""
:service_time_factor ""
:speed_factor ""
:type_id ""}]
:vehicles [{:break ""
:earliest_start 0
:end_address {}
:latest_end 0
:max_activities 0
:max_distance 0
:max_driving_time 0
:max_jobs 0
:min_jobs 0
:move_to_end_address false
:return_to_depot false
:skills []
:start_address {}
:type_id ""
:vehicle_id ""}]}})
require "http/client"
url = "{{baseUrl}}/vrp/optimize"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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}}/vrp/optimize"),
Content = new StringContent("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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}}/vrp/optimize");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/vrp/optimize"
payload := strings.NewReader("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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/vrp/optimize HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2414
{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/vrp/optimize")
.setHeader("content-type", "application/json")
.setBody("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/vrp/optimize"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/vrp/optimize")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/vrp/optimize")
.header("content-type", "application/json")
.body("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
algorithm: {
objective: '',
problem_type: ''
},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {
distances: [],
info: {
copyrights: [],
took: ''
},
times: []
},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [
{
type: '',
value: ''
}
],
relations: [],
services: [
{
address: {
curbside: '',
lat: '',
location_id: '',
lon: '',
name: '',
street_hint: ''
},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [
{
earliest: 0,
latest: 0
}
],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {
address: {},
duration: 0,
group: '',
preparation_time: 0,
time_windows: [
{}
]
},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/vrp/optimize');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/vrp/optimize',
headers: {'content-type': 'application/json'},
data: {
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/vrp/optimize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":{"objective":"","problem_type":""},"configuration":{"routing":{"calc_points":false,"consider_traffic":false,"curbside_strictness":"","fail_fast":false,"network_data_provider":"","return_snapped_waypoints":false,"snap_preventions":[]}},"cost_matrices":[{"data":{"distances":[],"info":{"copyrights":[],"took":""},"times":[]},"location_ids":[],"profile":"","type":""}],"objectives":[{"type":"","value":""}],"relations":[],"services":[{"address":{"curbside":"","lat":"","location_id":"","lon":"","name":"","street_hint":""},"allowed_vehicles":[],"disallowed_vehicles":[],"duration":0,"group":"","id":"","max_time_in_vehicle":0,"name":"","preparation_time":0,"priority":0,"required_skills":[],"size":[],"time_windows":[{"earliest":0,"latest":0}],"type":""}],"shipments":[{"allowed_vehicles":[],"delivery":{"address":{},"duration":0,"group":"","preparation_time":0,"time_windows":[{}]},"disallowed_vehicles":[],"id":"","max_time_in_vehicle":0,"name":"","pickup":{},"priority":0,"required_skills":[],"size":[]}],"vehicle_types":[{"capacity":[],"consider_traffic":false,"cost_per_activation":"","cost_per_meter":"","cost_per_second":"","network_data_provider":"","profile":"","service_time_factor":"","speed_factor":"","type_id":""}],"vehicles":[{"break":"","earliest_start":0,"end_address":{},"latest_end":0,"max_activities":0,"max_distance":0,"max_driving_time":0,"max_jobs":0,"min_jobs":0,"move_to_end_address":false,"return_to_depot":false,"skills":[],"start_address":{},"type_id":"","vehicle_id":""}]}'
};
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}}/vrp/optimize',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "algorithm": {\n "objective": "",\n "problem_type": ""\n },\n "configuration": {\n "routing": {\n "calc_points": false,\n "consider_traffic": false,\n "curbside_strictness": "",\n "fail_fast": false,\n "network_data_provider": "",\n "return_snapped_waypoints": false,\n "snap_preventions": []\n }\n },\n "cost_matrices": [\n {\n "data": {\n "distances": [],\n "info": {\n "copyrights": [],\n "took": ""\n },\n "times": []\n },\n "location_ids": [],\n "profile": "",\n "type": ""\n }\n ],\n "objectives": [\n {\n "type": "",\n "value": ""\n }\n ],\n "relations": [],\n "services": [\n {\n "address": {\n "curbside": "",\n "lat": "",\n "location_id": "",\n "lon": "",\n "name": "",\n "street_hint": ""\n },\n "allowed_vehicles": [],\n "disallowed_vehicles": [],\n "duration": 0,\n "group": "",\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "preparation_time": 0,\n "priority": 0,\n "required_skills": [],\n "size": [],\n "time_windows": [\n {\n "earliest": 0,\n "latest": 0\n }\n ],\n "type": ""\n }\n ],\n "shipments": [\n {\n "allowed_vehicles": [],\n "delivery": {\n "address": {},\n "duration": 0,\n "group": "",\n "preparation_time": 0,\n "time_windows": [\n {}\n ]\n },\n "disallowed_vehicles": [],\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "pickup": {},\n "priority": 0,\n "required_skills": [],\n "size": []\n }\n ],\n "vehicle_types": [\n {\n "capacity": [],\n "consider_traffic": false,\n "cost_per_activation": "",\n "cost_per_meter": "",\n "cost_per_second": "",\n "network_data_provider": "",\n "profile": "",\n "service_time_factor": "",\n "speed_factor": "",\n "type_id": ""\n }\n ],\n "vehicles": [\n {\n "break": "",\n "earliest_start": 0,\n "end_address": {},\n "latest_end": 0,\n "max_activities": 0,\n "max_distance": 0,\n "max_driving_time": 0,\n "max_jobs": 0,\n "min_jobs": 0,\n "move_to_end_address": false,\n "return_to_depot": false,\n "skills": [],\n "start_address": {},\n "type_id": "",\n "vehicle_id": ""\n }\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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/vrp/optimize")
.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/vrp/optimize',
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({
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/vrp/optimize',
headers: {'content-type': 'application/json'},
body: {
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
},
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}}/vrp/optimize');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
algorithm: {
objective: '',
problem_type: ''
},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {
distances: [],
info: {
copyrights: [],
took: ''
},
times: []
},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [
{
type: '',
value: ''
}
],
relations: [],
services: [
{
address: {
curbside: '',
lat: '',
location_id: '',
lon: '',
name: '',
street_hint: ''
},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [
{
earliest: 0,
latest: 0
}
],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {
address: {},
duration: 0,
group: '',
preparation_time: 0,
time_windows: [
{}
]
},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_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: 'POST',
url: '{{baseUrl}}/vrp/optimize',
headers: {'content-type': 'application/json'},
data: {
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/vrp/optimize';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":{"objective":"","problem_type":""},"configuration":{"routing":{"calc_points":false,"consider_traffic":false,"curbside_strictness":"","fail_fast":false,"network_data_provider":"","return_snapped_waypoints":false,"snap_preventions":[]}},"cost_matrices":[{"data":{"distances":[],"info":{"copyrights":[],"took":""},"times":[]},"location_ids":[],"profile":"","type":""}],"objectives":[{"type":"","value":""}],"relations":[],"services":[{"address":{"curbside":"","lat":"","location_id":"","lon":"","name":"","street_hint":""},"allowed_vehicles":[],"disallowed_vehicles":[],"duration":0,"group":"","id":"","max_time_in_vehicle":0,"name":"","preparation_time":0,"priority":0,"required_skills":[],"size":[],"time_windows":[{"earliest":0,"latest":0}],"type":""}],"shipments":[{"allowed_vehicles":[],"delivery":{"address":{},"duration":0,"group":"","preparation_time":0,"time_windows":[{}]},"disallowed_vehicles":[],"id":"","max_time_in_vehicle":0,"name":"","pickup":{},"priority":0,"required_skills":[],"size":[]}],"vehicle_types":[{"capacity":[],"consider_traffic":false,"cost_per_activation":"","cost_per_meter":"","cost_per_second":"","network_data_provider":"","profile":"","service_time_factor":"","speed_factor":"","type_id":""}],"vehicles":[{"break":"","earliest_start":0,"end_address":{},"latest_end":0,"max_activities":0,"max_distance":0,"max_driving_time":0,"max_jobs":0,"min_jobs":0,"move_to_end_address":false,"return_to_depot":false,"skills":[],"start_address":{},"type_id":"","vehicle_id":""}]}'
};
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 = @{ @"algorithm": @{ @"objective": @"", @"problem_type": @"" },
@"configuration": @{ @"routing": @{ @"calc_points": @NO, @"consider_traffic": @NO, @"curbside_strictness": @"", @"fail_fast": @NO, @"network_data_provider": @"", @"return_snapped_waypoints": @NO, @"snap_preventions": @[ ] } },
@"cost_matrices": @[ @{ @"data": @{ @"distances": @[ ], @"info": @{ @"copyrights": @[ ], @"took": @"" }, @"times": @[ ] }, @"location_ids": @[ ], @"profile": @"", @"type": @"" } ],
@"objectives": @[ @{ @"type": @"", @"value": @"" } ],
@"relations": @[ ],
@"services": @[ @{ @"address": @{ @"curbside": @"", @"lat": @"", @"location_id": @"", @"lon": @"", @"name": @"", @"street_hint": @"" }, @"allowed_vehicles": @[ ], @"disallowed_vehicles": @[ ], @"duration": @0, @"group": @"", @"id": @"", @"max_time_in_vehicle": @0, @"name": @"", @"preparation_time": @0, @"priority": @0, @"required_skills": @[ ], @"size": @[ ], @"time_windows": @[ @{ @"earliest": @0, @"latest": @0 } ], @"type": @"" } ],
@"shipments": @[ @{ @"allowed_vehicles": @[ ], @"delivery": @{ @"address": @{ }, @"duration": @0, @"group": @"", @"preparation_time": @0, @"time_windows": @[ @{ } ] }, @"disallowed_vehicles": @[ ], @"id": @"", @"max_time_in_vehicle": @0, @"name": @"", @"pickup": @{ }, @"priority": @0, @"required_skills": @[ ], @"size": @[ ] } ],
@"vehicle_types": @[ @{ @"capacity": @[ ], @"consider_traffic": @NO, @"cost_per_activation": @"", @"cost_per_meter": @"", @"cost_per_second": @"", @"network_data_provider": @"", @"profile": @"", @"service_time_factor": @"", @"speed_factor": @"", @"type_id": @"" } ],
@"vehicles": @[ @{ @"break": @"", @"earliest_start": @0, @"end_address": @{ }, @"latest_end": @0, @"max_activities": @0, @"max_distance": @0, @"max_driving_time": @0, @"max_jobs": @0, @"min_jobs": @0, @"move_to_end_address": @NO, @"return_to_depot": @NO, @"skills": @[ ], @"start_address": @{ }, @"type_id": @"", @"vehicle_id": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/vrp/optimize"]
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}}/vrp/optimize" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/vrp/optimize",
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([
'algorithm' => [
'objective' => '',
'problem_type' => ''
],
'configuration' => [
'routing' => [
'calc_points' => null,
'consider_traffic' => null,
'curbside_strictness' => '',
'fail_fast' => null,
'network_data_provider' => '',
'return_snapped_waypoints' => null,
'snap_preventions' => [
]
]
],
'cost_matrices' => [
[
'data' => [
'distances' => [
],
'info' => [
'copyrights' => [
],
'took' => ''
],
'times' => [
]
],
'location_ids' => [
],
'profile' => '',
'type' => ''
]
],
'objectives' => [
[
'type' => '',
'value' => ''
]
],
'relations' => [
],
'services' => [
[
'address' => [
'curbside' => '',
'lat' => '',
'location_id' => '',
'lon' => '',
'name' => '',
'street_hint' => ''
],
'allowed_vehicles' => [
],
'disallowed_vehicles' => [
],
'duration' => 0,
'group' => '',
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'preparation_time' => 0,
'priority' => 0,
'required_skills' => [
],
'size' => [
],
'time_windows' => [
[
'earliest' => 0,
'latest' => 0
]
],
'type' => ''
]
],
'shipments' => [
[
'allowed_vehicles' => [
],
'delivery' => [
'address' => [
],
'duration' => 0,
'group' => '',
'preparation_time' => 0,
'time_windows' => [
[
]
]
],
'disallowed_vehicles' => [
],
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'pickup' => [
],
'priority' => 0,
'required_skills' => [
],
'size' => [
]
]
],
'vehicle_types' => [
[
'capacity' => [
],
'consider_traffic' => null,
'cost_per_activation' => '',
'cost_per_meter' => '',
'cost_per_second' => '',
'network_data_provider' => '',
'profile' => '',
'service_time_factor' => '',
'speed_factor' => '',
'type_id' => ''
]
],
'vehicles' => [
[
'break' => '',
'earliest_start' => 0,
'end_address' => [
],
'latest_end' => 0,
'max_activities' => 0,
'max_distance' => 0,
'max_driving_time' => 0,
'max_jobs' => 0,
'min_jobs' => 0,
'move_to_end_address' => null,
'return_to_depot' => null,
'skills' => [
],
'start_address' => [
],
'type_id' => '',
'vehicle_id' => ''
]
]
]),
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}}/vrp/optimize', [
'body' => '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/vrp/optimize');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'algorithm' => [
'objective' => '',
'problem_type' => ''
],
'configuration' => [
'routing' => [
'calc_points' => null,
'consider_traffic' => null,
'curbside_strictness' => '',
'fail_fast' => null,
'network_data_provider' => '',
'return_snapped_waypoints' => null,
'snap_preventions' => [
]
]
],
'cost_matrices' => [
[
'data' => [
'distances' => [
],
'info' => [
'copyrights' => [
],
'took' => ''
],
'times' => [
]
],
'location_ids' => [
],
'profile' => '',
'type' => ''
]
],
'objectives' => [
[
'type' => '',
'value' => ''
]
],
'relations' => [
],
'services' => [
[
'address' => [
'curbside' => '',
'lat' => '',
'location_id' => '',
'lon' => '',
'name' => '',
'street_hint' => ''
],
'allowed_vehicles' => [
],
'disallowed_vehicles' => [
],
'duration' => 0,
'group' => '',
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'preparation_time' => 0,
'priority' => 0,
'required_skills' => [
],
'size' => [
],
'time_windows' => [
[
'earliest' => 0,
'latest' => 0
]
],
'type' => ''
]
],
'shipments' => [
[
'allowed_vehicles' => [
],
'delivery' => [
'address' => [
],
'duration' => 0,
'group' => '',
'preparation_time' => 0,
'time_windows' => [
[
]
]
],
'disallowed_vehicles' => [
],
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'pickup' => [
],
'priority' => 0,
'required_skills' => [
],
'size' => [
]
]
],
'vehicle_types' => [
[
'capacity' => [
],
'consider_traffic' => null,
'cost_per_activation' => '',
'cost_per_meter' => '',
'cost_per_second' => '',
'network_data_provider' => '',
'profile' => '',
'service_time_factor' => '',
'speed_factor' => '',
'type_id' => ''
]
],
'vehicles' => [
[
'break' => '',
'earliest_start' => 0,
'end_address' => [
],
'latest_end' => 0,
'max_activities' => 0,
'max_distance' => 0,
'max_driving_time' => 0,
'max_jobs' => 0,
'min_jobs' => 0,
'move_to_end_address' => null,
'return_to_depot' => null,
'skills' => [
],
'start_address' => [
],
'type_id' => '',
'vehicle_id' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'algorithm' => [
'objective' => '',
'problem_type' => ''
],
'configuration' => [
'routing' => [
'calc_points' => null,
'consider_traffic' => null,
'curbside_strictness' => '',
'fail_fast' => null,
'network_data_provider' => '',
'return_snapped_waypoints' => null,
'snap_preventions' => [
]
]
],
'cost_matrices' => [
[
'data' => [
'distances' => [
],
'info' => [
'copyrights' => [
],
'took' => ''
],
'times' => [
]
],
'location_ids' => [
],
'profile' => '',
'type' => ''
]
],
'objectives' => [
[
'type' => '',
'value' => ''
]
],
'relations' => [
],
'services' => [
[
'address' => [
'curbside' => '',
'lat' => '',
'location_id' => '',
'lon' => '',
'name' => '',
'street_hint' => ''
],
'allowed_vehicles' => [
],
'disallowed_vehicles' => [
],
'duration' => 0,
'group' => '',
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'preparation_time' => 0,
'priority' => 0,
'required_skills' => [
],
'size' => [
],
'time_windows' => [
[
'earliest' => 0,
'latest' => 0
]
],
'type' => ''
]
],
'shipments' => [
[
'allowed_vehicles' => [
],
'delivery' => [
'address' => [
],
'duration' => 0,
'group' => '',
'preparation_time' => 0,
'time_windows' => [
[
]
]
],
'disallowed_vehicles' => [
],
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'pickup' => [
],
'priority' => 0,
'required_skills' => [
],
'size' => [
]
]
],
'vehicle_types' => [
[
'capacity' => [
],
'consider_traffic' => null,
'cost_per_activation' => '',
'cost_per_meter' => '',
'cost_per_second' => '',
'network_data_provider' => '',
'profile' => '',
'service_time_factor' => '',
'speed_factor' => '',
'type_id' => ''
]
],
'vehicles' => [
[
'break' => '',
'earliest_start' => 0,
'end_address' => [
],
'latest_end' => 0,
'max_activities' => 0,
'max_distance' => 0,
'max_driving_time' => 0,
'max_jobs' => 0,
'min_jobs' => 0,
'move_to_end_address' => null,
'return_to_depot' => null,
'skills' => [
],
'start_address' => [
],
'type_id' => '',
'vehicle_id' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/vrp/optimize');
$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}}/vrp/optimize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/vrp/optimize' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/vrp/optimize", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/vrp/optimize"
payload = {
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": { "routing": {
"calc_points": False,
"consider_traffic": False,
"curbside_strictness": "",
"fail_fast": False,
"network_data_provider": "",
"return_snapped_waypoints": False,
"snap_preventions": []
} },
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [{}]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": False,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": False,
"return_to_depot": False,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/vrp/optimize"
payload <- "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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}}/vrp/optimize")
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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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/vrp/optimize') do |req|
req.body = "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/vrp/optimize";
let payload = json!({
"algorithm": json!({
"objective": "",
"problem_type": ""
}),
"configuration": json!({"routing": json!({
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": ()
})}),
"cost_matrices": (
json!({
"data": json!({
"distances": (),
"info": json!({
"copyrights": (),
"took": ""
}),
"times": ()
}),
"location_ids": (),
"profile": "",
"type": ""
})
),
"objectives": (
json!({
"type": "",
"value": ""
})
),
"relations": (),
"services": (
json!({
"address": json!({
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
}),
"allowed_vehicles": (),
"disallowed_vehicles": (),
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": (),
"size": (),
"time_windows": (
json!({
"earliest": 0,
"latest": 0
})
),
"type": ""
})
),
"shipments": (
json!({
"allowed_vehicles": (),
"delivery": json!({
"address": json!({}),
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": (json!({}))
}),
"disallowed_vehicles": (),
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": json!({}),
"priority": 0,
"required_skills": (),
"size": ()
})
),
"vehicle_types": (
json!({
"capacity": (),
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
})
),
"vehicles": (
json!({
"break": "",
"earliest_start": 0,
"end_address": json!({}),
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": (),
"start_address": json!({}),
"type_id": "",
"vehicle_id": ""
})
)
});
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}}/vrp/optimize \
--header 'content-type: application/json' \
--data '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}'
echo '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}' | \
http POST {{baseUrl}}/vrp/optimize \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "algorithm": {\n "objective": "",\n "problem_type": ""\n },\n "configuration": {\n "routing": {\n "calc_points": false,\n "consider_traffic": false,\n "curbside_strictness": "",\n "fail_fast": false,\n "network_data_provider": "",\n "return_snapped_waypoints": false,\n "snap_preventions": []\n }\n },\n "cost_matrices": [\n {\n "data": {\n "distances": [],\n "info": {\n "copyrights": [],\n "took": ""\n },\n "times": []\n },\n "location_ids": [],\n "profile": "",\n "type": ""\n }\n ],\n "objectives": [\n {\n "type": "",\n "value": ""\n }\n ],\n "relations": [],\n "services": [\n {\n "address": {\n "curbside": "",\n "lat": "",\n "location_id": "",\n "lon": "",\n "name": "",\n "street_hint": ""\n },\n "allowed_vehicles": [],\n "disallowed_vehicles": [],\n "duration": 0,\n "group": "",\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "preparation_time": 0,\n "priority": 0,\n "required_skills": [],\n "size": [],\n "time_windows": [\n {\n "earliest": 0,\n "latest": 0\n }\n ],\n "type": ""\n }\n ],\n "shipments": [\n {\n "allowed_vehicles": [],\n "delivery": {\n "address": {},\n "duration": 0,\n "group": "",\n "preparation_time": 0,\n "time_windows": [\n {}\n ]\n },\n "disallowed_vehicles": [],\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "pickup": {},\n "priority": 0,\n "required_skills": [],\n "size": []\n }\n ],\n "vehicle_types": [\n {\n "capacity": [],\n "consider_traffic": false,\n "cost_per_activation": "",\n "cost_per_meter": "",\n "cost_per_second": "",\n "network_data_provider": "",\n "profile": "",\n "service_time_factor": "",\n "speed_factor": "",\n "type_id": ""\n }\n ],\n "vehicles": [\n {\n "break": "",\n "earliest_start": 0,\n "end_address": {},\n "latest_end": 0,\n "max_activities": 0,\n "max_distance": 0,\n "max_driving_time": 0,\n "max_jobs": 0,\n "min_jobs": 0,\n "move_to_end_address": false,\n "return_to_depot": false,\n "skills": [],\n "start_address": {},\n "type_id": "",\n "vehicle_id": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/vrp/optimize
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"algorithm": [
"objective": "",
"problem_type": ""
],
"configuration": ["routing": [
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
]],
"cost_matrices": [
[
"data": [
"distances": [],
"info": [
"copyrights": [],
"took": ""
],
"times": []
],
"location_ids": [],
"profile": "",
"type": ""
]
],
"objectives": [
[
"type": "",
"value": ""
]
],
"relations": [],
"services": [
[
"address": [
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
],
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
[
"earliest": 0,
"latest": 0
]
],
"type": ""
]
],
"shipments": [
[
"allowed_vehicles": [],
"delivery": [
"address": [],
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [[]]
],
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": [],
"priority": 0,
"required_skills": [],
"size": []
]
],
"vehicle_types": [
[
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
]
],
"vehicles": [
[
"break": "",
"earliest_start": 0,
"end_address": [],
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": [],
"type_id": "",
"vehicle_id": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/vrp/optimize")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"job_id": "44886560-b584-4da5-b245-768151dacd8f"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Bad Request",
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"code": 500,
"message": "There has been an internal server error."
}
POST
POST route optimization problem
{{baseUrl}}/vrp
BODY json
{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/vrp");
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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/vrp" {:content-type :json
:form-params {:algorithm {:objective ""
:problem_type ""}
:configuration {:routing {:calc_points false
:consider_traffic false
:curbside_strictness ""
:fail_fast false
:network_data_provider ""
:return_snapped_waypoints false
:snap_preventions []}}
:cost_matrices [{:data {:distances []
:info {:copyrights []
:took ""}
:times []}
:location_ids []
:profile ""
:type ""}]
:objectives [{:type ""
:value ""}]
:relations []
:services [{:address {:curbside ""
:lat ""
:location_id ""
:lon ""
:name ""
:street_hint ""}
:allowed_vehicles []
:disallowed_vehicles []
:duration 0
:group ""
:id ""
:max_time_in_vehicle 0
:name ""
:preparation_time 0
:priority 0
:required_skills []
:size []
:time_windows [{:earliest 0
:latest 0}]
:type ""}]
:shipments [{:allowed_vehicles []
:delivery {:address {}
:duration 0
:group ""
:preparation_time 0
:time_windows [{}]}
:disallowed_vehicles []
:id ""
:max_time_in_vehicle 0
:name ""
:pickup {}
:priority 0
:required_skills []
:size []}]
:vehicle_types [{:capacity []
:consider_traffic false
:cost_per_activation ""
:cost_per_meter ""
:cost_per_second ""
:network_data_provider ""
:profile ""
:service_time_factor ""
:speed_factor ""
:type_id ""}]
:vehicles [{:break ""
:earliest_start 0
:end_address {}
:latest_end 0
:max_activities 0
:max_distance 0
:max_driving_time 0
:max_jobs 0
:min_jobs 0
:move_to_end_address false
:return_to_depot false
:skills []
:start_address {}
:type_id ""
:vehicle_id ""}]}})
require "http/client"
url = "{{baseUrl}}/vrp"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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}}/vrp"),
Content = new StringContent("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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}}/vrp");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/vrp"
payload := strings.NewReader("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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/vrp HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2414
{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/vrp")
.setHeader("content-type", "application/json")
.setBody("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/vrp"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/vrp")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/vrp")
.header("content-type", "application/json")
.body("{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
algorithm: {
objective: '',
problem_type: ''
},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {
distances: [],
info: {
copyrights: [],
took: ''
},
times: []
},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [
{
type: '',
value: ''
}
],
relations: [],
services: [
{
address: {
curbside: '',
lat: '',
location_id: '',
lon: '',
name: '',
street_hint: ''
},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [
{
earliest: 0,
latest: 0
}
],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {
address: {},
duration: 0,
group: '',
preparation_time: 0,
time_windows: [
{}
]
},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/vrp');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/vrp',
headers: {'content-type': 'application/json'},
data: {
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/vrp';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":{"objective":"","problem_type":""},"configuration":{"routing":{"calc_points":false,"consider_traffic":false,"curbside_strictness":"","fail_fast":false,"network_data_provider":"","return_snapped_waypoints":false,"snap_preventions":[]}},"cost_matrices":[{"data":{"distances":[],"info":{"copyrights":[],"took":""},"times":[]},"location_ids":[],"profile":"","type":""}],"objectives":[{"type":"","value":""}],"relations":[],"services":[{"address":{"curbside":"","lat":"","location_id":"","lon":"","name":"","street_hint":""},"allowed_vehicles":[],"disallowed_vehicles":[],"duration":0,"group":"","id":"","max_time_in_vehicle":0,"name":"","preparation_time":0,"priority":0,"required_skills":[],"size":[],"time_windows":[{"earliest":0,"latest":0}],"type":""}],"shipments":[{"allowed_vehicles":[],"delivery":{"address":{},"duration":0,"group":"","preparation_time":0,"time_windows":[{}]},"disallowed_vehicles":[],"id":"","max_time_in_vehicle":0,"name":"","pickup":{},"priority":0,"required_skills":[],"size":[]}],"vehicle_types":[{"capacity":[],"consider_traffic":false,"cost_per_activation":"","cost_per_meter":"","cost_per_second":"","network_data_provider":"","profile":"","service_time_factor":"","speed_factor":"","type_id":""}],"vehicles":[{"break":"","earliest_start":0,"end_address":{},"latest_end":0,"max_activities":0,"max_distance":0,"max_driving_time":0,"max_jobs":0,"min_jobs":0,"move_to_end_address":false,"return_to_depot":false,"skills":[],"start_address":{},"type_id":"","vehicle_id":""}]}'
};
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}}/vrp',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "algorithm": {\n "objective": "",\n "problem_type": ""\n },\n "configuration": {\n "routing": {\n "calc_points": false,\n "consider_traffic": false,\n "curbside_strictness": "",\n "fail_fast": false,\n "network_data_provider": "",\n "return_snapped_waypoints": false,\n "snap_preventions": []\n }\n },\n "cost_matrices": [\n {\n "data": {\n "distances": [],\n "info": {\n "copyrights": [],\n "took": ""\n },\n "times": []\n },\n "location_ids": [],\n "profile": "",\n "type": ""\n }\n ],\n "objectives": [\n {\n "type": "",\n "value": ""\n }\n ],\n "relations": [],\n "services": [\n {\n "address": {\n "curbside": "",\n "lat": "",\n "location_id": "",\n "lon": "",\n "name": "",\n "street_hint": ""\n },\n "allowed_vehicles": [],\n "disallowed_vehicles": [],\n "duration": 0,\n "group": "",\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "preparation_time": 0,\n "priority": 0,\n "required_skills": [],\n "size": [],\n "time_windows": [\n {\n "earliest": 0,\n "latest": 0\n }\n ],\n "type": ""\n }\n ],\n "shipments": [\n {\n "allowed_vehicles": [],\n "delivery": {\n "address": {},\n "duration": 0,\n "group": "",\n "preparation_time": 0,\n "time_windows": [\n {}\n ]\n },\n "disallowed_vehicles": [],\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "pickup": {},\n "priority": 0,\n "required_skills": [],\n "size": []\n }\n ],\n "vehicle_types": [\n {\n "capacity": [],\n "consider_traffic": false,\n "cost_per_activation": "",\n "cost_per_meter": "",\n "cost_per_second": "",\n "network_data_provider": "",\n "profile": "",\n "service_time_factor": "",\n "speed_factor": "",\n "type_id": ""\n }\n ],\n "vehicles": [\n {\n "break": "",\n "earliest_start": 0,\n "end_address": {},\n "latest_end": 0,\n "max_activities": 0,\n "max_distance": 0,\n "max_driving_time": 0,\n "max_jobs": 0,\n "min_jobs": 0,\n "move_to_end_address": false,\n "return_to_depot": false,\n "skills": [],\n "start_address": {},\n "type_id": "",\n "vehicle_id": ""\n }\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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/vrp")
.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/vrp',
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({
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/vrp',
headers: {'content-type': 'application/json'},
body: {
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
},
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}}/vrp');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
algorithm: {
objective: '',
problem_type: ''
},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {
distances: [],
info: {
copyrights: [],
took: ''
},
times: []
},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [
{
type: '',
value: ''
}
],
relations: [],
services: [
{
address: {
curbside: '',
lat: '',
location_id: '',
lon: '',
name: '',
street_hint: ''
},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [
{
earliest: 0,
latest: 0
}
],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {
address: {},
duration: 0,
group: '',
preparation_time: 0,
time_windows: [
{}
]
},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_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: 'POST',
url: '{{baseUrl}}/vrp',
headers: {'content-type': 'application/json'},
data: {
algorithm: {objective: '', problem_type: ''},
configuration: {
routing: {
calc_points: false,
consider_traffic: false,
curbside_strictness: '',
fail_fast: false,
network_data_provider: '',
return_snapped_waypoints: false,
snap_preventions: []
}
},
cost_matrices: [
{
data: {distances: [], info: {copyrights: [], took: ''}, times: []},
location_ids: [],
profile: '',
type: ''
}
],
objectives: [{type: '', value: ''}],
relations: [],
services: [
{
address: {curbside: '', lat: '', location_id: '', lon: '', name: '', street_hint: ''},
allowed_vehicles: [],
disallowed_vehicles: [],
duration: 0,
group: '',
id: '',
max_time_in_vehicle: 0,
name: '',
preparation_time: 0,
priority: 0,
required_skills: [],
size: [],
time_windows: [{earliest: 0, latest: 0}],
type: ''
}
],
shipments: [
{
allowed_vehicles: [],
delivery: {address: {}, duration: 0, group: '', preparation_time: 0, time_windows: [{}]},
disallowed_vehicles: [],
id: '',
max_time_in_vehicle: 0,
name: '',
pickup: {},
priority: 0,
required_skills: [],
size: []
}
],
vehicle_types: [
{
capacity: [],
consider_traffic: false,
cost_per_activation: '',
cost_per_meter: '',
cost_per_second: '',
network_data_provider: '',
profile: '',
service_time_factor: '',
speed_factor: '',
type_id: ''
}
],
vehicles: [
{
break: '',
earliest_start: 0,
end_address: {},
latest_end: 0,
max_activities: 0,
max_distance: 0,
max_driving_time: 0,
max_jobs: 0,
min_jobs: 0,
move_to_end_address: false,
return_to_depot: false,
skills: [],
start_address: {},
type_id: '',
vehicle_id: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/vrp';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":{"objective":"","problem_type":""},"configuration":{"routing":{"calc_points":false,"consider_traffic":false,"curbside_strictness":"","fail_fast":false,"network_data_provider":"","return_snapped_waypoints":false,"snap_preventions":[]}},"cost_matrices":[{"data":{"distances":[],"info":{"copyrights":[],"took":""},"times":[]},"location_ids":[],"profile":"","type":""}],"objectives":[{"type":"","value":""}],"relations":[],"services":[{"address":{"curbside":"","lat":"","location_id":"","lon":"","name":"","street_hint":""},"allowed_vehicles":[],"disallowed_vehicles":[],"duration":0,"group":"","id":"","max_time_in_vehicle":0,"name":"","preparation_time":0,"priority":0,"required_skills":[],"size":[],"time_windows":[{"earliest":0,"latest":0}],"type":""}],"shipments":[{"allowed_vehicles":[],"delivery":{"address":{},"duration":0,"group":"","preparation_time":0,"time_windows":[{}]},"disallowed_vehicles":[],"id":"","max_time_in_vehicle":0,"name":"","pickup":{},"priority":0,"required_skills":[],"size":[]}],"vehicle_types":[{"capacity":[],"consider_traffic":false,"cost_per_activation":"","cost_per_meter":"","cost_per_second":"","network_data_provider":"","profile":"","service_time_factor":"","speed_factor":"","type_id":""}],"vehicles":[{"break":"","earliest_start":0,"end_address":{},"latest_end":0,"max_activities":0,"max_distance":0,"max_driving_time":0,"max_jobs":0,"min_jobs":0,"move_to_end_address":false,"return_to_depot":false,"skills":[],"start_address":{},"type_id":"","vehicle_id":""}]}'
};
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 = @{ @"algorithm": @{ @"objective": @"", @"problem_type": @"" },
@"configuration": @{ @"routing": @{ @"calc_points": @NO, @"consider_traffic": @NO, @"curbside_strictness": @"", @"fail_fast": @NO, @"network_data_provider": @"", @"return_snapped_waypoints": @NO, @"snap_preventions": @[ ] } },
@"cost_matrices": @[ @{ @"data": @{ @"distances": @[ ], @"info": @{ @"copyrights": @[ ], @"took": @"" }, @"times": @[ ] }, @"location_ids": @[ ], @"profile": @"", @"type": @"" } ],
@"objectives": @[ @{ @"type": @"", @"value": @"" } ],
@"relations": @[ ],
@"services": @[ @{ @"address": @{ @"curbside": @"", @"lat": @"", @"location_id": @"", @"lon": @"", @"name": @"", @"street_hint": @"" }, @"allowed_vehicles": @[ ], @"disallowed_vehicles": @[ ], @"duration": @0, @"group": @"", @"id": @"", @"max_time_in_vehicle": @0, @"name": @"", @"preparation_time": @0, @"priority": @0, @"required_skills": @[ ], @"size": @[ ], @"time_windows": @[ @{ @"earliest": @0, @"latest": @0 } ], @"type": @"" } ],
@"shipments": @[ @{ @"allowed_vehicles": @[ ], @"delivery": @{ @"address": @{ }, @"duration": @0, @"group": @"", @"preparation_time": @0, @"time_windows": @[ @{ } ] }, @"disallowed_vehicles": @[ ], @"id": @"", @"max_time_in_vehicle": @0, @"name": @"", @"pickup": @{ }, @"priority": @0, @"required_skills": @[ ], @"size": @[ ] } ],
@"vehicle_types": @[ @{ @"capacity": @[ ], @"consider_traffic": @NO, @"cost_per_activation": @"", @"cost_per_meter": @"", @"cost_per_second": @"", @"network_data_provider": @"", @"profile": @"", @"service_time_factor": @"", @"speed_factor": @"", @"type_id": @"" } ],
@"vehicles": @[ @{ @"break": @"", @"earliest_start": @0, @"end_address": @{ }, @"latest_end": @0, @"max_activities": @0, @"max_distance": @0, @"max_driving_time": @0, @"max_jobs": @0, @"min_jobs": @0, @"move_to_end_address": @NO, @"return_to_depot": @NO, @"skills": @[ ], @"start_address": @{ }, @"type_id": @"", @"vehicle_id": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/vrp"]
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}}/vrp" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/vrp",
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([
'algorithm' => [
'objective' => '',
'problem_type' => ''
],
'configuration' => [
'routing' => [
'calc_points' => null,
'consider_traffic' => null,
'curbside_strictness' => '',
'fail_fast' => null,
'network_data_provider' => '',
'return_snapped_waypoints' => null,
'snap_preventions' => [
]
]
],
'cost_matrices' => [
[
'data' => [
'distances' => [
],
'info' => [
'copyrights' => [
],
'took' => ''
],
'times' => [
]
],
'location_ids' => [
],
'profile' => '',
'type' => ''
]
],
'objectives' => [
[
'type' => '',
'value' => ''
]
],
'relations' => [
],
'services' => [
[
'address' => [
'curbside' => '',
'lat' => '',
'location_id' => '',
'lon' => '',
'name' => '',
'street_hint' => ''
],
'allowed_vehicles' => [
],
'disallowed_vehicles' => [
],
'duration' => 0,
'group' => '',
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'preparation_time' => 0,
'priority' => 0,
'required_skills' => [
],
'size' => [
],
'time_windows' => [
[
'earliest' => 0,
'latest' => 0
]
],
'type' => ''
]
],
'shipments' => [
[
'allowed_vehicles' => [
],
'delivery' => [
'address' => [
],
'duration' => 0,
'group' => '',
'preparation_time' => 0,
'time_windows' => [
[
]
]
],
'disallowed_vehicles' => [
],
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'pickup' => [
],
'priority' => 0,
'required_skills' => [
],
'size' => [
]
]
],
'vehicle_types' => [
[
'capacity' => [
],
'consider_traffic' => null,
'cost_per_activation' => '',
'cost_per_meter' => '',
'cost_per_second' => '',
'network_data_provider' => '',
'profile' => '',
'service_time_factor' => '',
'speed_factor' => '',
'type_id' => ''
]
],
'vehicles' => [
[
'break' => '',
'earliest_start' => 0,
'end_address' => [
],
'latest_end' => 0,
'max_activities' => 0,
'max_distance' => 0,
'max_driving_time' => 0,
'max_jobs' => 0,
'min_jobs' => 0,
'move_to_end_address' => null,
'return_to_depot' => null,
'skills' => [
],
'start_address' => [
],
'type_id' => '',
'vehicle_id' => ''
]
]
]),
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}}/vrp', [
'body' => '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/vrp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'algorithm' => [
'objective' => '',
'problem_type' => ''
],
'configuration' => [
'routing' => [
'calc_points' => null,
'consider_traffic' => null,
'curbside_strictness' => '',
'fail_fast' => null,
'network_data_provider' => '',
'return_snapped_waypoints' => null,
'snap_preventions' => [
]
]
],
'cost_matrices' => [
[
'data' => [
'distances' => [
],
'info' => [
'copyrights' => [
],
'took' => ''
],
'times' => [
]
],
'location_ids' => [
],
'profile' => '',
'type' => ''
]
],
'objectives' => [
[
'type' => '',
'value' => ''
]
],
'relations' => [
],
'services' => [
[
'address' => [
'curbside' => '',
'lat' => '',
'location_id' => '',
'lon' => '',
'name' => '',
'street_hint' => ''
],
'allowed_vehicles' => [
],
'disallowed_vehicles' => [
],
'duration' => 0,
'group' => '',
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'preparation_time' => 0,
'priority' => 0,
'required_skills' => [
],
'size' => [
],
'time_windows' => [
[
'earliest' => 0,
'latest' => 0
]
],
'type' => ''
]
],
'shipments' => [
[
'allowed_vehicles' => [
],
'delivery' => [
'address' => [
],
'duration' => 0,
'group' => '',
'preparation_time' => 0,
'time_windows' => [
[
]
]
],
'disallowed_vehicles' => [
],
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'pickup' => [
],
'priority' => 0,
'required_skills' => [
],
'size' => [
]
]
],
'vehicle_types' => [
[
'capacity' => [
],
'consider_traffic' => null,
'cost_per_activation' => '',
'cost_per_meter' => '',
'cost_per_second' => '',
'network_data_provider' => '',
'profile' => '',
'service_time_factor' => '',
'speed_factor' => '',
'type_id' => ''
]
],
'vehicles' => [
[
'break' => '',
'earliest_start' => 0,
'end_address' => [
],
'latest_end' => 0,
'max_activities' => 0,
'max_distance' => 0,
'max_driving_time' => 0,
'max_jobs' => 0,
'min_jobs' => 0,
'move_to_end_address' => null,
'return_to_depot' => null,
'skills' => [
],
'start_address' => [
],
'type_id' => '',
'vehicle_id' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'algorithm' => [
'objective' => '',
'problem_type' => ''
],
'configuration' => [
'routing' => [
'calc_points' => null,
'consider_traffic' => null,
'curbside_strictness' => '',
'fail_fast' => null,
'network_data_provider' => '',
'return_snapped_waypoints' => null,
'snap_preventions' => [
]
]
],
'cost_matrices' => [
[
'data' => [
'distances' => [
],
'info' => [
'copyrights' => [
],
'took' => ''
],
'times' => [
]
],
'location_ids' => [
],
'profile' => '',
'type' => ''
]
],
'objectives' => [
[
'type' => '',
'value' => ''
]
],
'relations' => [
],
'services' => [
[
'address' => [
'curbside' => '',
'lat' => '',
'location_id' => '',
'lon' => '',
'name' => '',
'street_hint' => ''
],
'allowed_vehicles' => [
],
'disallowed_vehicles' => [
],
'duration' => 0,
'group' => '',
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'preparation_time' => 0,
'priority' => 0,
'required_skills' => [
],
'size' => [
],
'time_windows' => [
[
'earliest' => 0,
'latest' => 0
]
],
'type' => ''
]
],
'shipments' => [
[
'allowed_vehicles' => [
],
'delivery' => [
'address' => [
],
'duration' => 0,
'group' => '',
'preparation_time' => 0,
'time_windows' => [
[
]
]
],
'disallowed_vehicles' => [
],
'id' => '',
'max_time_in_vehicle' => 0,
'name' => '',
'pickup' => [
],
'priority' => 0,
'required_skills' => [
],
'size' => [
]
]
],
'vehicle_types' => [
[
'capacity' => [
],
'consider_traffic' => null,
'cost_per_activation' => '',
'cost_per_meter' => '',
'cost_per_second' => '',
'network_data_provider' => '',
'profile' => '',
'service_time_factor' => '',
'speed_factor' => '',
'type_id' => ''
]
],
'vehicles' => [
[
'break' => '',
'earliest_start' => 0,
'end_address' => [
],
'latest_end' => 0,
'max_activities' => 0,
'max_distance' => 0,
'max_driving_time' => 0,
'max_jobs' => 0,
'min_jobs' => 0,
'move_to_end_address' => null,
'return_to_depot' => null,
'skills' => [
],
'start_address' => [
],
'type_id' => '',
'vehicle_id' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/vrp');
$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}}/vrp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/vrp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/vrp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/vrp"
payload = {
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": { "routing": {
"calc_points": False,
"consider_traffic": False,
"curbside_strictness": "",
"fail_fast": False,
"network_data_provider": "",
"return_snapped_waypoints": False,
"snap_preventions": []
} },
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [{}]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": False,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": False,
"return_to_depot": False,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/vrp"
payload <- "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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}}/vrp")
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 \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\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/vrp') do |req|
req.body = "{\n \"algorithm\": {\n \"objective\": \"\",\n \"problem_type\": \"\"\n },\n \"configuration\": {\n \"routing\": {\n \"calc_points\": false,\n \"consider_traffic\": false,\n \"curbside_strictness\": \"\",\n \"fail_fast\": false,\n \"network_data_provider\": \"\",\n \"return_snapped_waypoints\": false,\n \"snap_preventions\": []\n }\n },\n \"cost_matrices\": [\n {\n \"data\": {\n \"distances\": [],\n \"info\": {\n \"copyrights\": [],\n \"took\": \"\"\n },\n \"times\": []\n },\n \"location_ids\": [],\n \"profile\": \"\",\n \"type\": \"\"\n }\n ],\n \"objectives\": [\n {\n \"type\": \"\",\n \"value\": \"\"\n }\n ],\n \"relations\": [],\n \"services\": [\n {\n \"address\": {\n \"curbside\": \"\",\n \"lat\": \"\",\n \"location_id\": \"\",\n \"lon\": \"\",\n \"name\": \"\",\n \"street_hint\": \"\"\n },\n \"allowed_vehicles\": [],\n \"disallowed_vehicles\": [],\n \"duration\": 0,\n \"group\": \"\",\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"preparation_time\": 0,\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": [],\n \"time_windows\": [\n {\n \"earliest\": 0,\n \"latest\": 0\n }\n ],\n \"type\": \"\"\n }\n ],\n \"shipments\": [\n {\n \"allowed_vehicles\": [],\n \"delivery\": {\n \"address\": {},\n \"duration\": 0,\n \"group\": \"\",\n \"preparation_time\": 0,\n \"time_windows\": [\n {}\n ]\n },\n \"disallowed_vehicles\": [],\n \"id\": \"\",\n \"max_time_in_vehicle\": 0,\n \"name\": \"\",\n \"pickup\": {},\n \"priority\": 0,\n \"required_skills\": [],\n \"size\": []\n }\n ],\n \"vehicle_types\": [\n {\n \"capacity\": [],\n \"consider_traffic\": false,\n \"cost_per_activation\": \"\",\n \"cost_per_meter\": \"\",\n \"cost_per_second\": \"\",\n \"network_data_provider\": \"\",\n \"profile\": \"\",\n \"service_time_factor\": \"\",\n \"speed_factor\": \"\",\n \"type_id\": \"\"\n }\n ],\n \"vehicles\": [\n {\n \"break\": \"\",\n \"earliest_start\": 0,\n \"end_address\": {},\n \"latest_end\": 0,\n \"max_activities\": 0,\n \"max_distance\": 0,\n \"max_driving_time\": 0,\n \"max_jobs\": 0,\n \"min_jobs\": 0,\n \"move_to_end_address\": false,\n \"return_to_depot\": false,\n \"skills\": [],\n \"start_address\": {},\n \"type_id\": \"\",\n \"vehicle_id\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/vrp";
let payload = json!({
"algorithm": json!({
"objective": "",
"problem_type": ""
}),
"configuration": json!({"routing": json!({
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": ()
})}),
"cost_matrices": (
json!({
"data": json!({
"distances": (),
"info": json!({
"copyrights": (),
"took": ""
}),
"times": ()
}),
"location_ids": (),
"profile": "",
"type": ""
})
),
"objectives": (
json!({
"type": "",
"value": ""
})
),
"relations": (),
"services": (
json!({
"address": json!({
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
}),
"allowed_vehicles": (),
"disallowed_vehicles": (),
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": (),
"size": (),
"time_windows": (
json!({
"earliest": 0,
"latest": 0
})
),
"type": ""
})
),
"shipments": (
json!({
"allowed_vehicles": (),
"delivery": json!({
"address": json!({}),
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": (json!({}))
}),
"disallowed_vehicles": (),
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": json!({}),
"priority": 0,
"required_skills": (),
"size": ()
})
),
"vehicle_types": (
json!({
"capacity": (),
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
})
),
"vehicles": (
json!({
"break": "",
"earliest_start": 0,
"end_address": json!({}),
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": (),
"start_address": json!({}),
"type_id": "",
"vehicle_id": ""
})
)
});
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}}/vrp \
--header 'content-type: application/json' \
--data '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}'
echo '{
"algorithm": {
"objective": "",
"problem_type": ""
},
"configuration": {
"routing": {
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
}
},
"cost_matrices": [
{
"data": {
"distances": [],
"info": {
"copyrights": [],
"took": ""
},
"times": []
},
"location_ids": [],
"profile": "",
"type": ""
}
],
"objectives": [
{
"type": "",
"value": ""
}
],
"relations": [],
"services": [
{
"address": {
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
},
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
{
"earliest": 0,
"latest": 0
}
],
"type": ""
}
],
"shipments": [
{
"allowed_vehicles": [],
"delivery": {
"address": {},
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [
{}
]
},
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": {},
"priority": 0,
"required_skills": [],
"size": []
}
],
"vehicle_types": [
{
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
}
],
"vehicles": [
{
"break": "",
"earliest_start": 0,
"end_address": {},
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": {},
"type_id": "",
"vehicle_id": ""
}
]
}' | \
http POST {{baseUrl}}/vrp \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "algorithm": {\n "objective": "",\n "problem_type": ""\n },\n "configuration": {\n "routing": {\n "calc_points": false,\n "consider_traffic": false,\n "curbside_strictness": "",\n "fail_fast": false,\n "network_data_provider": "",\n "return_snapped_waypoints": false,\n "snap_preventions": []\n }\n },\n "cost_matrices": [\n {\n "data": {\n "distances": [],\n "info": {\n "copyrights": [],\n "took": ""\n },\n "times": []\n },\n "location_ids": [],\n "profile": "",\n "type": ""\n }\n ],\n "objectives": [\n {\n "type": "",\n "value": ""\n }\n ],\n "relations": [],\n "services": [\n {\n "address": {\n "curbside": "",\n "lat": "",\n "location_id": "",\n "lon": "",\n "name": "",\n "street_hint": ""\n },\n "allowed_vehicles": [],\n "disallowed_vehicles": [],\n "duration": 0,\n "group": "",\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "preparation_time": 0,\n "priority": 0,\n "required_skills": [],\n "size": [],\n "time_windows": [\n {\n "earliest": 0,\n "latest": 0\n }\n ],\n "type": ""\n }\n ],\n "shipments": [\n {\n "allowed_vehicles": [],\n "delivery": {\n "address": {},\n "duration": 0,\n "group": "",\n "preparation_time": 0,\n "time_windows": [\n {}\n ]\n },\n "disallowed_vehicles": [],\n "id": "",\n "max_time_in_vehicle": 0,\n "name": "",\n "pickup": {},\n "priority": 0,\n "required_skills": [],\n "size": []\n }\n ],\n "vehicle_types": [\n {\n "capacity": [],\n "consider_traffic": false,\n "cost_per_activation": "",\n "cost_per_meter": "",\n "cost_per_second": "",\n "network_data_provider": "",\n "profile": "",\n "service_time_factor": "",\n "speed_factor": "",\n "type_id": ""\n }\n ],\n "vehicles": [\n {\n "break": "",\n "earliest_start": 0,\n "end_address": {},\n "latest_end": 0,\n "max_activities": 0,\n "max_distance": 0,\n "max_driving_time": 0,\n "max_jobs": 0,\n "min_jobs": 0,\n "move_to_end_address": false,\n "return_to_depot": false,\n "skills": [],\n "start_address": {},\n "type_id": "",\n "vehicle_id": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/vrp
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"algorithm": [
"objective": "",
"problem_type": ""
],
"configuration": ["routing": [
"calc_points": false,
"consider_traffic": false,
"curbside_strictness": "",
"fail_fast": false,
"network_data_provider": "",
"return_snapped_waypoints": false,
"snap_preventions": []
]],
"cost_matrices": [
[
"data": [
"distances": [],
"info": [
"copyrights": [],
"took": ""
],
"times": []
],
"location_ids": [],
"profile": "",
"type": ""
]
],
"objectives": [
[
"type": "",
"value": ""
]
],
"relations": [],
"services": [
[
"address": [
"curbside": "",
"lat": "",
"location_id": "",
"lon": "",
"name": "",
"street_hint": ""
],
"allowed_vehicles": [],
"disallowed_vehicles": [],
"duration": 0,
"group": "",
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"preparation_time": 0,
"priority": 0,
"required_skills": [],
"size": [],
"time_windows": [
[
"earliest": 0,
"latest": 0
]
],
"type": ""
]
],
"shipments": [
[
"allowed_vehicles": [],
"delivery": [
"address": [],
"duration": 0,
"group": "",
"preparation_time": 0,
"time_windows": [[]]
],
"disallowed_vehicles": [],
"id": "",
"max_time_in_vehicle": 0,
"name": "",
"pickup": [],
"priority": 0,
"required_skills": [],
"size": []
]
],
"vehicle_types": [
[
"capacity": [],
"consider_traffic": false,
"cost_per_activation": "",
"cost_per_meter": "",
"cost_per_second": "",
"network_data_provider": "",
"profile": "",
"service_time_factor": "",
"speed_factor": "",
"type_id": ""
]
],
"vehicles": [
[
"break": "",
"earliest_start": 0,
"end_address": [],
"latest_end": 0,
"max_activities": 0,
"max_distance": 0,
"max_driving_time": 0,
"max_jobs": 0,
"min_jobs": 0,
"move_to_end_address": false,
"return_to_depot": false,
"skills": [],
"start_address": [],
"type_id": "",
"vehicle_id": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/vrp")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"job_id": "d62fcadd-c84a-4298-90b5-28550125bec5",
"processing_time": 459,
"solution": {
"completion_time": 4172,
"costs": 438,
"distance": 17994,
"max_operation_time": 2465,
"no_unassigned": 0,
"no_vehicles": 2,
"preparation_time": 0,
"routes": [
{
"activities": [
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"distance": 0,
"driving_time": 0,
"end_date_time": null,
"end_time": 1554804329,
"load_after": [
0
],
"location_id": "berlin",
"preparation_time": 0,
"type": "start",
"waiting_time": 0
},
{
"address": {
"lat": 52.529961,
"location_id": "13.387613_52.529961",
"lon": 13.387613
},
"arr_date_time": null,
"arr_time": 1554804789,
"distance": 2012,
"driving_time": 460,
"end_date_time": null,
"end_time": 1554804789,
"id": "7fe77504-7df8-4497-843c-02d70b6490ce",
"load_after": [
1
],
"load_before": [
0
],
"location_id": "13.387613_52.529961",
"preparation_time": 0,
"type": "pickupShipment",
"waiting_time": 0
},
{
"address": {
"lat": 52.513614,
"location_id": "13.380575_52.513614",
"lon": 13.380575
},
"arr_date_time": null,
"arr_time": 1554805344,
"distance": 4560,
"driving_time": 1015,
"end_date_time": null,
"end_time": 1554805344,
"id": "7fe77504-7df8-4497-843c-02d70b6490ce",
"load_after": [
0
],
"load_before": [
1
],
"location_id": "13.380575_52.513614",
"preparation_time": 0,
"type": "deliverShipment",
"waiting_time": 0
},
{
"address": {
"lat": 52.514038,
"location_id": "13.395767_52.514038",
"lon": 13.395767
},
"arr_date_time": null,
"arr_time": 1554805632,
"distance": 5887,
"driving_time": 1303,
"end_date_time": null,
"end_time": 1554805632,
"id": "s-4",
"load_after": [
1
],
"load_before": [
0
],
"location_id": "13.395767_52.514038",
"preparation_time": 0,
"type": "service",
"waiting_time": 0
},
{
"address": {
"lat": 52.523543,
"location_id": "13.416882_52.523543",
"lon": 13.416882
},
"arr_date_time": null,
"arr_time": 1554806253,
"distance": 8486,
"driving_time": 1924,
"end_date_time": null,
"end_time": 1554806253,
"id": "s-3",
"load_after": [
2
],
"load_before": [
1
],
"location_id": "13.416882_52.523543",
"preparation_time": 0,
"type": "service",
"waiting_time": 0
},
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"arr_date_time": null,
"arr_time": 1554806794,
"distance": 10618,
"driving_time": 2465,
"load_before": [
2
],
"location_id": "berlin",
"preparation_time": 0,
"type": "end",
"waiting_time": 0
}
],
"completion_time": 2465,
"distance": 10618,
"points": [
{
"coordinates": [
[
13.40608,
52.53701
],
[
13.40643,
52.53631
],
[
13.40554,
52.53616
],
[
13.4054,
52.53608
],
[
13.40445,
52.53513
],
[
13.40436,
52.53509
],
[
13.40428,
52.53508
],
[
13.40463,
52.53419
],
[
13.40451,
52.53419
],
[
13.4034,
52.53401
],
[
13.403,
52.53359
],
[
13.40291,
52.53354
],
[
13.40268,
52.53347
],
[
13.39888,
52.53259
],
[
13.39839,
52.53253
],
[
13.39812,
52.53251
],
[
13.39616,
52.53243
],
[
13.39579,
52.5324
],
[
13.38973,
52.53173
],
[
13.39163,
52.53025
],
[
13.38797,
52.52935
],
[
13.38763,
52.52996
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.38763,
52.52996
],
[
13.38739,
52.53039
],
[
13.38724,
52.53036
],
[
13.38464,
52.52929
],
[
13.38538,
52.52871
],
[
13.38634,
52.52792
],
[
13.38638,
52.52779
],
[
13.38657,
52.52763
],
[
13.38676,
52.52741
],
[
13.38698,
52.52713
],
[
13.38704,
52.52701
],
[
13.38753,
52.524
],
[
13.3877,
52.52307
],
[
13.3878,
52.52282
],
[
13.38788,
52.52252
],
[
13.38802,
52.52174
],
[
13.38519,
52.52009
],
[
13.38539,
52.5191
],
[
13.38548,
52.51852
],
[
13.38042,
52.51819
],
[
13.38071,
52.5167
],
[
13.38076,
52.51652
],
[
13.38084,
52.51634
],
[
13.3821,
52.51396
],
[
13.38055,
52.51365
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.38055,
52.51365
],
[
13.38229,
52.514
],
[
13.38363,
52.51429
],
[
13.3848,
52.51445
],
[
13.38504,
52.51358
],
[
13.39124,
52.51397
],
[
13.3911,
52.51488
],
[
13.39303,
52.51499
],
[
13.39317,
52.5141
],
[
13.39548,
52.51419
],
[
13.39571,
52.51421
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.39571,
52.51421
],
[
13.39695,
52.51434
],
[
13.39674,
52.51523
],
[
13.39742,
52.51531
],
[
13.39873,
52.51558
],
[
13.39846,
52.51599
],
[
13.39825,
52.51729
],
[
13.39805,
52.51755
],
[
13.39892,
52.51761
],
[
13.39917,
52.51764
],
[
13.39964,
52.51775
],
[
13.40009,
52.51791
],
[
13.40034,
52.51797
],
[
13.4021,
52.51864
],
[
13.40288,
52.51896
],
[
13.40375,
52.51936
],
[
13.40498,
52.52001
],
[
13.40463,
52.5203
],
[
13.40311,
52.52144
],
[
13.40442,
52.52189
],
[
13.40448,
52.52192
],
[
13.40451,
52.52195
],
[
13.40473,
52.52199
],
[
13.40504,
52.52208
],
[
13.40572,
52.52235
],
[
13.40687,
52.52294
],
[
13.40693,
52.52299
],
[
13.40706,
52.52319
],
[
13.40738,
52.52378
],
[
13.40787,
52.52443
],
[
13.4079,
52.52453
],
[
13.40938,
52.52401
],
[
13.40962,
52.52398
],
[
13.41001,
52.52395
],
[
13.41072,
52.52391
],
[
13.41215,
52.52389
],
[
13.41233,
52.52386
],
[
13.4131,
52.5235
],
[
13.41288,
52.52333
],
[
13.41475,
52.52247
],
[
13.41496,
52.52264
],
[
13.41523,
52.52251
],
[
13.41633,
52.52338
],
[
13.41631,
52.52346
],
[
13.41654,
52.52364
],
[
13.41684,
52.52351
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.41684,
52.52351
],
[
13.41654,
52.52364
],
[
13.41631,
52.52346
],
[
13.4163,
52.52344
],
[
13.41587,
52.52363
],
[
13.41572,
52.5235
],
[
13.41409,
52.5242
],
[
13.41454,
52.52461
],
[
13.41454,
52.52466
],
[
13.41358,
52.52508
],
[
13.41366,
52.52514
],
[
13.41344,
52.52525
],
[
13.4133,
52.52514
],
[
13.41316,
52.5252
],
[
13.41107,
52.52585
],
[
13.41118,
52.52606
],
[
13.41118,
52.52616
],
[
13.41095,
52.52664
],
[
13.41097,
52.52678
],
[
13.41084,
52.52706
],
[
13.41057,
52.52747
],
[
13.41028,
52.52809
],
[
13.41032,
52.52821
],
[
13.4102,
52.52847
],
[
13.40999,
52.52875
],
[
13.40984,
52.52905
],
[
13.40982,
52.52914
],
[
13.40984,
52.52926
],
[
13.4104,
52.52998
],
[
13.4105,
52.53001
],
[
13.41064,
52.53016
],
[
13.41082,
52.5303
],
[
13.41198,
52.53107
],
[
13.4122,
52.53128
],
[
13.41232,
52.53143
],
[
13.41247,
52.53192
],
[
13.41267,
52.53245
],
[
13.41275,
52.53259
],
[
13.41215,
52.5327
],
[
13.40731,
52.53463
],
[
13.40608,
52.53701
]
],
"type": "LineString"
}
],
"preparation_time": 0,
"service_duration": 0,
"transport_time": 2465,
"vehicle_id": "vehicle-2",
"waiting_time": 0
},
{
"activities": [
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"distance": 0,
"driving_time": 0,
"end_date_time": null,
"end_time": 1554804329,
"load_after": [
0
],
"location_id": "berlin",
"preparation_time": 0,
"type": "start",
"waiting_time": 0
},
{
"address": {
"lat": 52.525851,
"location_id": "13.393364_52.525851",
"lon": 13.393364
},
"arr_date_time": null,
"arr_time": 1554804743,
"distance": 1884,
"driving_time": 414,
"end_date_time": null,
"end_time": 1554804743,
"id": "s-2",
"load_after": [
1
],
"load_before": [
0
],
"location_id": "13.393364_52.525851",
"preparation_time": 0,
"type": "service",
"waiting_time": 0
},
{
"address": {
"lat": 52.537338,
"location_id": "13.375854_52.537338",
"lon": 13.375854
},
"arr_date_time": null,
"arr_time": 1554805251,
"distance": 4205,
"driving_time": 922,
"end_date_time": null,
"end_time": 1554805329,
"id": "s-1",
"load_after": [
2
],
"load_before": [
1
],
"location_id": "13.375854_52.537338",
"preparation_time": 0,
"type": "service",
"waiting_time": 78
},
{
"address": {
"lat": 52.537,
"location_id": "berlin",
"lon": 13.406
},
"arr_date_time": null,
"arr_time": 1554806036,
"distance": 7376,
"driving_time": 1629,
"load_before": [
2
],
"location_id": "berlin",
"preparation_time": 0,
"type": "end",
"waiting_time": 0
}
],
"completion_time": 1707,
"distance": 7376,
"points": [
{
"coordinates": [
[
13.40608,
52.53701
],
[
13.40674,
52.53571
],
[
13.40433,
52.53313
],
[
13.40271,
52.53149
],
[
13.40246,
52.53121
],
[
13.40148,
52.52999
],
[
13.40128,
52.52993
],
[
13.40118,
52.52988
],
[
13.40133,
52.5296
],
[
13.40138,
52.52951
],
[
13.40167,
52.52914
],
[
13.40188,
52.52895
],
[
13.398,
52.52885
],
[
13.39289,
52.52748
],
[
13.39354,
52.5264
],
[
13.39358,
52.52628
],
[
13.39324,
52.52575
],
[
13.39334,
52.52573
],
[
13.39339,
52.52584
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.39339,
52.52584
],
[
13.3934,
52.52599
],
[
13.39358,
52.52628
],
[
13.39354,
52.5264
],
[
13.39242,
52.52823
],
[
13.39381,
52.52852
],
[
13.38973,
52.53173
],
[
13.38717,
52.5315
],
[
13.38678,
52.5315
],
[
13.38641,
52.53147
],
[
13.38617,
52.53143
],
[
13.38607,
52.53155
],
[
13.38526,
52.53225
],
[
13.38501,
52.53252
],
[
13.38316,
52.53418
],
[
13.38179,
52.5355
],
[
13.38084,
52.53523
],
[
13.38081,
52.53531
],
[
13.3795,
52.53677
],
[
13.37941,
52.53682
],
[
13.37935,
52.53683
],
[
13.37919,
52.53682
],
[
13.37617,
52.5361
],
[
13.37502,
52.53698
],
[
13.37584,
52.53734
]
],
"type": "LineString"
},
{
"coordinates": [
[
13.37584,
52.53734
],
[
13.37566,
52.53726
],
[
13.37515,
52.53763
],
[
13.37644,
52.53841
],
[
13.37807,
52.53935
],
[
13.37946,
52.5402
],
[
13.3796,
52.54019
],
[
13.37984,
52.54021
],
[
13.37988,
52.54012
],
[
13.38062,
52.53936
],
[
13.38169,
52.53832
],
[
13.38236,
52.5377
],
[
13.38363,
52.53661
],
[
13.38492,
52.53555
],
[
13.38613,
52.53447
],
[
13.38757,
52.53338
],
[
13.38791,
52.53354
],
[
13.38812,
52.53368
],
[
13.38833,
52.53392
],
[
13.38977,
52.53518
],
[
13.39003,
52.53539
],
[
13.39256,
52.53701
],
[
13.39316,
52.53739
],
[
13.39327,
52.53744
],
[
13.3936,
52.53757
],
[
13.40155,
52.53982
],
[
13.40357,
52.53715
],
[
13.40372,
52.53719
],
[
13.40465,
52.53727
],
[
13.4048,
52.53726
],
[
13.4059,
52.53736
],
[
13.40608,
52.53701
]
],
"type": "LineString"
}
],
"preparation_time": 0,
"service_duration": 0,
"transport_time": 1629,
"vehicle_id": "vehicle-1",
"waiting_time": 78
}
],
"service_duration": 0,
"time": 4094,
"transport_time": 4094,
"unassigned": {
"breaks": [],
"details": [],
"services": [],
"shipments": []
},
"waiting_time": 78
},
"status": "finished",
"waiting_time_in_queue": 0
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"message": "Bad Request",
"status": "finished"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"code": 500,
"message": "There has been an internal server error."
}
GET
Coverage information
{{baseUrl}}/route/info
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/route/info");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/route/info")
require "http/client"
url = "{{baseUrl}}/route/info"
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}}/route/info"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/route/info");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/route/info"
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/route/info HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/route/info")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/route/info"))
.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}}/route/info")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/route/info")
.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}}/route/info');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/route/info'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/route/info';
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}}/route/info',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/route/info")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/route/info',
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}}/route/info'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/route/info');
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}}/route/info'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/route/info';
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}}/route/info"]
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}}/route/info" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/route/info",
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}}/route/info');
echo $response->getBody();
setUrl('{{baseUrl}}/route/info');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/route/info');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/route/info' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/route/info' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/route/info")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/route/info"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/route/info"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/route/info")
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/route/info') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/route/info";
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}}/route/info
http GET {{baseUrl}}/route/info
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/route/info
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/route/info")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"bbox": [
13.072624,
52.333508,
13.763972,
52.679616
],
"build_date": "2014-02-21T16:52",
"features": {
"car": {
"elevation": false
},
"foot": {
"elevation": true
}
},
"version": "0.4"
}
GET
GET Route Endpoint
{{baseUrl}}/route
QUERY PARAMS
point
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/route?point=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/route" {:query-params {:point ""}})
require "http/client"
url = "{{baseUrl}}/route?point="
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}}/route?point="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/route?point=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/route?point="
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/route?point= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/route?point=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/route?point="))
.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}}/route?point=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/route?point=")
.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}}/route?point=');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/route', params: {point: ''}};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/route?point=';
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}}/route?point=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/route?point=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/route?point=',
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}}/route', qs: {point: ''}};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/route');
req.query({
point: ''
});
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}}/route', params: {point: ''}};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/route?point=';
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}}/route?point="]
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}}/route?point=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/route?point=",
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}}/route?point=');
echo $response->getBody();
setUrl('{{baseUrl}}/route');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'point' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/route');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'point' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/route?point=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/route?point=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/route?point=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/route"
querystring = {"point":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/route"
queryString <- list(point = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/route?point=")
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/route') do |req|
req.params['point'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/route";
let querystring = [
("point", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/route?point='
http GET '{{baseUrl}}/route?point='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/route?point='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/route?point=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hints": {
"visited_nodes.average": 58,
"visited_nodes.sum": 58
},
"info": {
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"took": 2
},
"paths": [
{
"ascend": 6.3294677734375,
"bbox": [
11.539424,
48.118343,
11.558901,
48.122364
],
"descend": 25.0579833984375,
"details": {},
"distance": 1791.011,
"instructions": [
{
"distance": 672.954,
"heading": 89.04,
"interval": [
0,
6
],
"sign": 0,
"street_name": "Lindenschmitstraße",
"text": "Continue onto Lindenschmitstraße",
"time": 144703
},
{
"distance": 107.145,
"interval": [
6,
7
],
"sign": -2,
"street_name": "",
"text": "Turn left",
"time": 22675
},
{
"distance": 140.169,
"interval": [
7,
10
],
"sign": 2,
"street_name": "Oberländerstraße",
"text": "Turn right onto Oberländerstraße",
"time": 28032
},
{
"distance": 360.232,
"interval": [
10,
18
],
"sign": 1,
"street_name": "",
"text": "Turn slight right",
"time": 72677
},
{
"distance": 177.621,
"interval": [
18,
20
],
"sign": 2,
"street_name": "Thalkirchner Straße",
"text": "Turn right onto Thalkirchner Straße",
"time": 35524
},
{
"distance": 332.89,
"interval": [
20,
24
],
"sign": -2,
"street_name": "Thalkirchner Straße",
"text": "Turn left onto Thalkirchner Straße",
"time": 67351
},
{
"distance": 0,
"interval": [
24,
24
],
"last_heading": 45.67046584987792,
"sign": 4,
"street_name": "",
"text": "Arrive at destination",
"time": 0
}
],
"legs": [],
"points": {
"coordinates": [
[
11.539424,
48.118352
],
[
11.540387,
48.118368
],
[
11.54061,
48.118356
],
[
11.541941,
48.118409
],
[
11.543696,
48.118344
],
[
11.547167,
48.118343
],
[
11.548478,
48.118366
],
[
11.548487,
48.119329
],
[
11.548807,
48.119328
],
[
11.549408,
48.119366
],
[
11.550349,
48.119508
],
[
11.550441,
48.119473
],
[
11.551109,
48.119467
],
[
11.551553,
48.119445
],
[
11.551748,
48.119398
],
[
11.552087,
48.119475
],
[
11.552236,
48.119542
],
[
11.552353,
48.119635
],
[
11.553853,
48.121136
],
[
11.555448,
48.12039
],
[
11.555797,
48.120206
],
[
11.55632,
48.120592
],
[
11.556716,
48.120919
],
[
11.557326,
48.121345
],
[
11.558901,
48.122364
]
],
"type": "LineString"
},
"points_encoded": false,
"snapped_waypoints": {
"coordinates": [
[
11.539424,
48.118352
],
[
11.558901,
48.122364
]
],
"type": "LineString"
},
"time": 370962,
"transfers": 0,
"weight": 307.852443
}
]
}
POST
POST Route Endpoint
{{baseUrl}}/route
BODY json
{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/route");
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 \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/route" {:content-type :json
:form-params {:algorithm ""
:alternative_route.max_paths 0
:alternative_route.max_share_factor ""
:alternative_route.max_weight_factor ""
:avoid ""
:block_area ""
:calc_points false
:ch.disable false
:curbsides []
:debug false
:details []
:elevation false
:heading_penalty 0
:headings []
:instructions false
:locale ""
:optimize ""
:pass_through false
:point_hints []
:points []
:points_encoded false
:round_trip.distance 0
:round_trip.seed 0
:snap_preventions []
:vehicle ""
:weighting ""}})
require "http/client"
url = "{{baseUrl}}/route"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\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}}/route"),
Content = new StringContent("{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\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}}/route");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/route"
payload := strings.NewReader("{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\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/route HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 608
{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/route")
.setHeader("content-type", "application/json")
.setBody("{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/route"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\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 \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/route")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/route")
.header("content-type", "application/json")
.body("{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}")
.asString();
const data = JSON.stringify({
algorithm: '',
'alternative_route.max_paths': 0,
'alternative_route.max_share_factor': '',
'alternative_route.max_weight_factor': '',
avoid: '',
block_area: '',
calc_points: false,
'ch.disable': false,
curbsides: [],
debug: false,
details: [],
elevation: false,
heading_penalty: 0,
headings: [],
instructions: false,
locale: '',
optimize: '',
pass_through: false,
point_hints: [],
points: [],
points_encoded: false,
'round_trip.distance': 0,
'round_trip.seed': 0,
snap_preventions: [],
vehicle: '',
weighting: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/route');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/route',
headers: {'content-type': 'application/json'},
data: {
algorithm: '',
'alternative_route.max_paths': 0,
'alternative_route.max_share_factor': '',
'alternative_route.max_weight_factor': '',
avoid: '',
block_area: '',
calc_points: false,
'ch.disable': false,
curbsides: [],
debug: false,
details: [],
elevation: false,
heading_penalty: 0,
headings: [],
instructions: false,
locale: '',
optimize: '',
pass_through: false,
point_hints: [],
points: [],
points_encoded: false,
'round_trip.distance': 0,
'round_trip.seed': 0,
snap_preventions: [],
vehicle: '',
weighting: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/route';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":"","alternative_route.max_paths":0,"alternative_route.max_share_factor":"","alternative_route.max_weight_factor":"","avoid":"","block_area":"","calc_points":false,"ch.disable":false,"curbsides":[],"debug":false,"details":[],"elevation":false,"heading_penalty":0,"headings":[],"instructions":false,"locale":"","optimize":"","pass_through":false,"point_hints":[],"points":[],"points_encoded":false,"round_trip.distance":0,"round_trip.seed":0,"snap_preventions":[],"vehicle":"","weighting":""}'
};
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}}/route',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "algorithm": "",\n "alternative_route.max_paths": 0,\n "alternative_route.max_share_factor": "",\n "alternative_route.max_weight_factor": "",\n "avoid": "",\n "block_area": "",\n "calc_points": false,\n "ch.disable": false,\n "curbsides": [],\n "debug": false,\n "details": [],\n "elevation": false,\n "heading_penalty": 0,\n "headings": [],\n "instructions": false,\n "locale": "",\n "optimize": "",\n "pass_through": false,\n "point_hints": [],\n "points": [],\n "points_encoded": false,\n "round_trip.distance": 0,\n "round_trip.seed": 0,\n "snap_preventions": [],\n "vehicle": "",\n "weighting": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/route")
.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/route',
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({
algorithm: '',
'alternative_route.max_paths': 0,
'alternative_route.max_share_factor': '',
'alternative_route.max_weight_factor': '',
avoid: '',
block_area: '',
calc_points: false,
'ch.disable': false,
curbsides: [],
debug: false,
details: [],
elevation: false,
heading_penalty: 0,
headings: [],
instructions: false,
locale: '',
optimize: '',
pass_through: false,
point_hints: [],
points: [],
points_encoded: false,
'round_trip.distance': 0,
'round_trip.seed': 0,
snap_preventions: [],
vehicle: '',
weighting: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/route',
headers: {'content-type': 'application/json'},
body: {
algorithm: '',
'alternative_route.max_paths': 0,
'alternative_route.max_share_factor': '',
'alternative_route.max_weight_factor': '',
avoid: '',
block_area: '',
calc_points: false,
'ch.disable': false,
curbsides: [],
debug: false,
details: [],
elevation: false,
heading_penalty: 0,
headings: [],
instructions: false,
locale: '',
optimize: '',
pass_through: false,
point_hints: [],
points: [],
points_encoded: false,
'round_trip.distance': 0,
'round_trip.seed': 0,
snap_preventions: [],
vehicle: '',
weighting: ''
},
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}}/route');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
algorithm: '',
'alternative_route.max_paths': 0,
'alternative_route.max_share_factor': '',
'alternative_route.max_weight_factor': '',
avoid: '',
block_area: '',
calc_points: false,
'ch.disable': false,
curbsides: [],
debug: false,
details: [],
elevation: false,
heading_penalty: 0,
headings: [],
instructions: false,
locale: '',
optimize: '',
pass_through: false,
point_hints: [],
points: [],
points_encoded: false,
'round_trip.distance': 0,
'round_trip.seed': 0,
snap_preventions: [],
vehicle: '',
weighting: ''
});
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}}/route',
headers: {'content-type': 'application/json'},
data: {
algorithm: '',
'alternative_route.max_paths': 0,
'alternative_route.max_share_factor': '',
'alternative_route.max_weight_factor': '',
avoid: '',
block_area: '',
calc_points: false,
'ch.disable': false,
curbsides: [],
debug: false,
details: [],
elevation: false,
heading_penalty: 0,
headings: [],
instructions: false,
locale: '',
optimize: '',
pass_through: false,
point_hints: [],
points: [],
points_encoded: false,
'round_trip.distance': 0,
'round_trip.seed': 0,
snap_preventions: [],
vehicle: '',
weighting: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/route';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithm":"","alternative_route.max_paths":0,"alternative_route.max_share_factor":"","alternative_route.max_weight_factor":"","avoid":"","block_area":"","calc_points":false,"ch.disable":false,"curbsides":[],"debug":false,"details":[],"elevation":false,"heading_penalty":0,"headings":[],"instructions":false,"locale":"","optimize":"","pass_through":false,"point_hints":[],"points":[],"points_encoded":false,"round_trip.distance":0,"round_trip.seed":0,"snap_preventions":[],"vehicle":"","weighting":""}'
};
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 = @{ @"algorithm": @"",
@"alternative_route.max_paths": @0,
@"alternative_route.max_share_factor": @"",
@"alternative_route.max_weight_factor": @"",
@"avoid": @"",
@"block_area": @"",
@"calc_points": @NO,
@"ch.disable": @NO,
@"curbsides": @[ ],
@"debug": @NO,
@"details": @[ ],
@"elevation": @NO,
@"heading_penalty": @0,
@"headings": @[ ],
@"instructions": @NO,
@"locale": @"",
@"optimize": @"",
@"pass_through": @NO,
@"point_hints": @[ ],
@"points": @[ ],
@"points_encoded": @NO,
@"round_trip.distance": @0,
@"round_trip.seed": @0,
@"snap_preventions": @[ ],
@"vehicle": @"",
@"weighting": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/route"]
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}}/route" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/route",
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([
'algorithm' => '',
'alternative_route.max_paths' => 0,
'alternative_route.max_share_factor' => '',
'alternative_route.max_weight_factor' => '',
'avoid' => '',
'block_area' => '',
'calc_points' => null,
'ch.disable' => null,
'curbsides' => [
],
'debug' => null,
'details' => [
],
'elevation' => null,
'heading_penalty' => 0,
'headings' => [
],
'instructions' => null,
'locale' => '',
'optimize' => '',
'pass_through' => null,
'point_hints' => [
],
'points' => [
],
'points_encoded' => null,
'round_trip.distance' => 0,
'round_trip.seed' => 0,
'snap_preventions' => [
],
'vehicle' => '',
'weighting' => ''
]),
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}}/route', [
'body' => '{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/route');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'algorithm' => '',
'alternative_route.max_paths' => 0,
'alternative_route.max_share_factor' => '',
'alternative_route.max_weight_factor' => '',
'avoid' => '',
'block_area' => '',
'calc_points' => null,
'ch.disable' => null,
'curbsides' => [
],
'debug' => null,
'details' => [
],
'elevation' => null,
'heading_penalty' => 0,
'headings' => [
],
'instructions' => null,
'locale' => '',
'optimize' => '',
'pass_through' => null,
'point_hints' => [
],
'points' => [
],
'points_encoded' => null,
'round_trip.distance' => 0,
'round_trip.seed' => 0,
'snap_preventions' => [
],
'vehicle' => '',
'weighting' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'algorithm' => '',
'alternative_route.max_paths' => 0,
'alternative_route.max_share_factor' => '',
'alternative_route.max_weight_factor' => '',
'avoid' => '',
'block_area' => '',
'calc_points' => null,
'ch.disable' => null,
'curbsides' => [
],
'debug' => null,
'details' => [
],
'elevation' => null,
'heading_penalty' => 0,
'headings' => [
],
'instructions' => null,
'locale' => '',
'optimize' => '',
'pass_through' => null,
'point_hints' => [
],
'points' => [
],
'points_encoded' => null,
'round_trip.distance' => 0,
'round_trip.seed' => 0,
'snap_preventions' => [
],
'vehicle' => '',
'weighting' => ''
]));
$request->setRequestUrl('{{baseUrl}}/route');
$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}}/route' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/route' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/route", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/route"
payload = {
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": False,
"ch.disable": False,
"curbsides": [],
"debug": False,
"details": [],
"elevation": False,
"heading_penalty": 0,
"headings": [],
"instructions": False,
"locale": "",
"optimize": "",
"pass_through": False,
"point_hints": [],
"points": [],
"points_encoded": False,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/route"
payload <- "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\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}}/route")
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 \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\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/route') do |req|
req.body = "{\n \"algorithm\": \"\",\n \"alternative_route.max_paths\": 0,\n \"alternative_route.max_share_factor\": \"\",\n \"alternative_route.max_weight_factor\": \"\",\n \"avoid\": \"\",\n \"block_area\": \"\",\n \"calc_points\": false,\n \"ch.disable\": false,\n \"curbsides\": [],\n \"debug\": false,\n \"details\": [],\n \"elevation\": false,\n \"heading_penalty\": 0,\n \"headings\": [],\n \"instructions\": false,\n \"locale\": \"\",\n \"optimize\": \"\",\n \"pass_through\": false,\n \"point_hints\": [],\n \"points\": [],\n \"points_encoded\": false,\n \"round_trip.distance\": 0,\n \"round_trip.seed\": 0,\n \"snap_preventions\": [],\n \"vehicle\": \"\",\n \"weighting\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/route";
let payload = json!({
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": (),
"debug": false,
"details": (),
"elevation": false,
"heading_penalty": 0,
"headings": (),
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": (),
"points": (),
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": (),
"vehicle": "",
"weighting": ""
});
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}}/route \
--header 'content-type: application/json' \
--data '{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}'
echo '{
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
}' | \
http POST {{baseUrl}}/route \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "algorithm": "",\n "alternative_route.max_paths": 0,\n "alternative_route.max_share_factor": "",\n "alternative_route.max_weight_factor": "",\n "avoid": "",\n "block_area": "",\n "calc_points": false,\n "ch.disable": false,\n "curbsides": [],\n "debug": false,\n "details": [],\n "elevation": false,\n "heading_penalty": 0,\n "headings": [],\n "instructions": false,\n "locale": "",\n "optimize": "",\n "pass_through": false,\n "point_hints": [],\n "points": [],\n "points_encoded": false,\n "round_trip.distance": 0,\n "round_trip.seed": 0,\n "snap_preventions": [],\n "vehicle": "",\n "weighting": ""\n}' \
--output-document \
- {{baseUrl}}/route
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"algorithm": "",
"alternative_route.max_paths": 0,
"alternative_route.max_share_factor": "",
"alternative_route.max_weight_factor": "",
"avoid": "",
"block_area": "",
"calc_points": false,
"ch.disable": false,
"curbsides": [],
"debug": false,
"details": [],
"elevation": false,
"heading_penalty": 0,
"headings": [],
"instructions": false,
"locale": "",
"optimize": "",
"pass_through": false,
"point_hints": [],
"points": [],
"points_encoded": false,
"round_trip.distance": 0,
"round_trip.seed": 0,
"snap_preventions": [],
"vehicle": "",
"weighting": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/route")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"hints": {
"visited_nodes.average": 58,
"visited_nodes.sum": 58
},
"info": {
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"took": 2
},
"paths": [
{
"ascend": 6.3294677734375,
"bbox": [
11.539424,
48.118343,
11.558901,
48.122364
],
"descend": 25.0579833984375,
"details": {},
"distance": 1791.011,
"instructions": [
{
"distance": 672.954,
"heading": 89.04,
"interval": [
0,
6
],
"sign": 0,
"street_name": "Lindenschmitstraße",
"text": "Continue onto Lindenschmitstraße",
"time": 144703
},
{
"distance": 107.145,
"interval": [
6,
7
],
"sign": -2,
"street_name": "",
"text": "Turn left",
"time": 22675
},
{
"distance": 140.169,
"interval": [
7,
10
],
"sign": 2,
"street_name": "Oberländerstraße",
"text": "Turn right onto Oberländerstraße",
"time": 28032
},
{
"distance": 360.232,
"interval": [
10,
18
],
"sign": 1,
"street_name": "",
"text": "Turn slight right",
"time": 72677
},
{
"distance": 177.621,
"interval": [
18,
20
],
"sign": 2,
"street_name": "Thalkirchner Straße",
"text": "Turn right onto Thalkirchner Straße",
"time": 35524
},
{
"distance": 332.89,
"interval": [
20,
24
],
"sign": -2,
"street_name": "Thalkirchner Straße",
"text": "Turn left onto Thalkirchner Straße",
"time": 67351
},
{
"distance": 0,
"interval": [
24,
24
],
"last_heading": 45.67046584987792,
"sign": 4,
"street_name": "",
"text": "Arrive at destination",
"time": 0
}
],
"legs": [],
"points": {
"coordinates": [
[
11.539424,
48.118352
],
[
11.540387,
48.118368
],
[
11.54061,
48.118356
],
[
11.541941,
48.118409
],
[
11.543696,
48.118344
],
[
11.547167,
48.118343
],
[
11.548478,
48.118366
],
[
11.548487,
48.119329
],
[
11.548807,
48.119328
],
[
11.549408,
48.119366
],
[
11.550349,
48.119508
],
[
11.550441,
48.119473
],
[
11.551109,
48.119467
],
[
11.551553,
48.119445
],
[
11.551748,
48.119398
],
[
11.552087,
48.119475
],
[
11.552236,
48.119542
],
[
11.552353,
48.119635
],
[
11.553853,
48.121136
],
[
11.555448,
48.12039
],
[
11.555797,
48.120206
],
[
11.55632,
48.120592
],
[
11.556716,
48.120919
],
[
11.557326,
48.121345
],
[
11.558901,
48.122364
]
],
"type": "LineString"
},
"points_encoded": false,
"snapped_waypoints": {
"coordinates": [
[
11.539424,
48.118352
],
[
11.558901,
48.122364
]
],
"type": "LineString"
},
"time": 370962,
"transfers": 0,
"weight": 307.852443
}
]
}