POST Create a new address
{{baseUrl}}/:passengerId/addresses
QUERY PARAMS

passengerId
BODY json

{
  "name": "",
  "addressId": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:passengerId/addresses");

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  \"name\": \"\",\n  \"addressId\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/:passengerId/addresses" {:content-type :json
                                                                   :form-params {:name ""
                                                                                 :addressId ""}})
require "http/client"

url = "{{baseUrl}}/:passengerId/addresses"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"name\": \"\",\n  \"addressId\": \"\"\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}}/:passengerId/addresses"),
    Content = new StringContent("{\n  \"name\": \"\",\n  \"addressId\": \"\"\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}}/:passengerId/addresses");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:passengerId/addresses"

	payload := strings.NewReader("{\n  \"name\": \"\",\n  \"addressId\": \"\"\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/:passengerId/addresses HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35

{
  "name": "",
  "addressId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:passengerId/addresses")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:passengerId/addresses"))
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"name\": \"\",\n  \"addressId\": \"\"\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  \"name\": \"\",\n  \"addressId\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/:passengerId/addresses")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:passengerId/addresses")
  .header("content-type", "application/json")
  .body("{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  name: '',
  addressId: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/:passengerId/addresses');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/:passengerId/addresses',
  headers: {'content-type': 'application/json'},
  data: {name: '', addressId: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:passengerId/addresses';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"name":"","addressId":""}'
};

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}}/:passengerId/addresses',
  method: 'POST',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "name": "",\n  "addressId": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/:passengerId/addresses")
  .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/:passengerId/addresses',
  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({name: '', addressId: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/:passengerId/addresses',
  headers: {'content-type': 'application/json'},
  body: {name: '', addressId: ''},
  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}}/:passengerId/addresses');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  name: '',
  addressId: ''
});

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}}/:passengerId/addresses',
  headers: {'content-type': 'application/json'},
  data: {name: '', addressId: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:passengerId/addresses';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"name":"","addressId":""}'
};

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 = @{ @"name": @"",
                              @"addressId": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:passengerId/addresses"]
                                                       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}}/:passengerId/addresses" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:passengerId/addresses",
  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([
    'name' => '',
    'addressId' => ''
  ]),
  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}}/:passengerId/addresses', [
  'body' => '{
  "name": "",
  "addressId": ""
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/:passengerId/addresses');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'name' => '',
  'addressId' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'name' => '',
  'addressId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:passengerId/addresses');
$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}}/:passengerId/addresses' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "name": "",
  "addressId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:passengerId/addresses' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "name": "",
  "addressId": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/baseUrl/:passengerId/addresses", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:passengerId/addresses"

payload = {
    "name": "",
    "addressId": ""
}
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:passengerId/addresses"

payload <- "{\n  \"name\": \"\",\n  \"addressId\": \"\"\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}}/:passengerId/addresses")

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  \"name\": \"\",\n  \"addressId\": \"\"\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/:passengerId/addresses') do |req|
  req.body = "{\n  \"name\": \"\",\n  \"addressId\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:passengerId/addresses";

    let payload = json!({
        "name": "",
        "addressId": ""
    });

    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}}/:passengerId/addresses \
  --header 'content-type: application/json' \
  --data '{
  "name": "",
  "addressId": ""
}'
echo '{
  "name": "",
  "addressId": ""
}' |  \
  http POST {{baseUrl}}/:passengerId/addresses \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'content-type: application/json' \
  --body-data '{\n  "name": "",\n  "addressId": ""\n}' \
  --output-document \
  - {{baseUrl}}/:passengerId/addresses
import Foundation

let headers = ["content-type": "application/json"]
let parameters = [
  "name": "",
  "addressId": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:passengerId/addresses")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
DELETE Delete an address
{{baseUrl}}/:passengerId/addresses/:addressId
QUERY PARAMS

passengerId
addressId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:passengerId/addresses/:addressId");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/delete "{{baseUrl}}/:passengerId/addresses/:addressId")
require "http/client"

url = "{{baseUrl}}/:passengerId/addresses/:addressId"

response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/:passengerId/addresses/:addressId"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:passengerId/addresses/:addressId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:passengerId/addresses/:addressId"

	req, _ := http.NewRequest("DELETE", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
DELETE /baseUrl/:passengerId/addresses/:addressId HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:passengerId/addresses/:addressId")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:passengerId/addresses/:addressId"))
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/:passengerId/addresses/:addressId")
  .delete(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:passengerId/addresses/:addressId")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('DELETE', '{{baseUrl}}/:passengerId/addresses/:addressId');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/:passengerId/addresses/:addressId'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:passengerId/addresses/:addressId';
const options = {method: 'DELETE'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/:passengerId/addresses/:addressId',
  method: 'DELETE',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/:passengerId/addresses/:addressId")
  .delete(null)
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/:passengerId/addresses/:addressId',
  headers: {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/:passengerId/addresses/:addressId'
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('DELETE', '{{baseUrl}}/:passengerId/addresses/:addressId');

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/:passengerId/addresses/:addressId'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:passengerId/addresses/:addressId';
const options = {method: 'DELETE'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:passengerId/addresses/:addressId"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/:passengerId/addresses/:addressId" in

Client.call `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:passengerId/addresses/:addressId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/:passengerId/addresses/:addressId');

echo $response->getBody();
setUrl('{{baseUrl}}/:passengerId/addresses/:addressId');
$request->setMethod(HTTP_METH_DELETE);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/:passengerId/addresses/:addressId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:passengerId/addresses/:addressId' -Method DELETE 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:passengerId/addresses/:addressId' -Method DELETE 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("DELETE", "/baseUrl/:passengerId/addresses/:addressId")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:passengerId/addresses/:addressId"

response = requests.delete(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:passengerId/addresses/:addressId"

response <- VERB("DELETE", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/:passengerId/addresses/:addressId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.delete('/baseUrl/:passengerId/addresses/:addressId') do |req|
end

puts response.status
puts response.body
use std::str::FromStr;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:passengerId/addresses/:addressId";

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/:passengerId/addresses/:addressId
http DELETE {{baseUrl}}/:passengerId/addresses/:addressId
wget --quiet \
  --method DELETE \
  --output-document \
  - {{baseUrl}}/:passengerId/addresses/:addressId
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:passengerId/addresses/:addressId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
POST Create a new passenger
{{baseUrl}}/
BODY json

{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/");

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  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/" {:content-type :json
                                             :form-params {:name ""
                                                           :email ""
                                                           :mobilePhoneNumber ""
                                                           :userAddresses [{:name ""
                                                                            :addressId ""}]}})
require "http/client"

url = "{{baseUrl}}/"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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}}/"),
    Content = new StringContent("{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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}}/");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/"

	payload := strings.NewReader("{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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/ HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 136

{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/"))
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/")
  .header("content-type", "application/json")
  .body("{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}")
  .asString();
const data = JSON.stringify({
  name: '',
  email: '',
  mobilePhoneNumber: '',
  userAddresses: [
    {
      name: '',
      addressId: ''
    }
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/',
  headers: {'content-type': 'application/json'},
  data: {
    name: '',
    email: '',
    mobilePhoneNumber: '',
    userAddresses: [{name: '', addressId: ''}]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"name":"","email":"","mobilePhoneNumber":"","userAddresses":[{"name":"","addressId":""}]}'
};

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}}/',
  method: 'POST',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "name": "",\n  "email": "",\n  "mobilePhoneNumber": "",\n  "userAddresses": [\n    {\n      "name": "",\n      "addressId": ""\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  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/")
  .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/',
  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({
  name: '',
  email: '',
  mobilePhoneNumber: '',
  userAddresses: [{name: '', addressId: ''}]
}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/',
  headers: {'content-type': 'application/json'},
  body: {
    name: '',
    email: '',
    mobilePhoneNumber: '',
    userAddresses: [{name: '', addressId: ''}]
  },
  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}}/');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  name: '',
  email: '',
  mobilePhoneNumber: '',
  userAddresses: [
    {
      name: '',
      addressId: ''
    }
  ]
});

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}}/',
  headers: {'content-type': 'application/json'},
  data: {
    name: '',
    email: '',
    mobilePhoneNumber: '',
    userAddresses: [{name: '', addressId: ''}]
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"name":"","email":"","mobilePhoneNumber":"","userAddresses":[{"name":"","addressId":""}]}'
};

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 = @{ @"name": @"",
                              @"email": @"",
                              @"mobilePhoneNumber": @"",
                              @"userAddresses": @[ @{ @"name": @"", @"addressId": @"" } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/"]
                                                       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}}/" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/",
  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([
    'name' => '',
    'email' => '',
    'mobilePhoneNumber' => '',
    'userAddresses' => [
        [
                'name' => '',
                'addressId' => ''
        ]
    ]
  ]),
  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}}/', [
  'body' => '{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'name' => '',
  'email' => '',
  'mobilePhoneNumber' => '',
  'userAddresses' => [
    [
        'name' => '',
        'addressId' => ''
    ]
  ]
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'name' => '',
  'email' => '',
  'mobilePhoneNumber' => '',
  'userAddresses' => [
    [
        'name' => '',
        'addressId' => ''
    ]
  ]
]));
$request->setRequestUrl('{{baseUrl}}/');
$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}}/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\n    }\n  ]\n}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/baseUrl/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/"

payload = {
    "name": "",
    "email": "",
    "mobilePhoneNumber": "",
    "userAddresses": [
        {
            "name": "",
            "addressId": ""
        }
    ]
}
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/"

payload <- "{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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}}/")

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  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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/') do |req|
  req.body = "{\n  \"name\": \"\",\n  \"email\": \"\",\n  \"mobilePhoneNumber\": \"\",\n  \"userAddresses\": [\n    {\n      \"name\": \"\",\n      \"addressId\": \"\"\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}}/";

    let payload = json!({
        "name": "",
        "email": "",
        "mobilePhoneNumber": "",
        "userAddresses": (
            json!({
                "name": "",
                "addressId": ""
            })
        )
    });

    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}}/ \
  --header 'content-type: application/json' \
  --data '{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}'
echo '{
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    {
      "name": "",
      "addressId": ""
    }
  ]
}' |  \
  http POST {{baseUrl}}/ \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'content-type: application/json' \
  --body-data '{\n  "name": "",\n  "email": "",\n  "mobilePhoneNumber": "",\n  "userAddresses": [\n    {\n      "name": "",\n      "addressId": ""\n    }\n  ]\n}' \
  --output-document \
  - {{baseUrl}}/
import Foundation

let headers = ["content-type": "application/json"]
let parameters = [
  "name": "",
  "email": "",
  "mobilePhoneNumber": "",
  "userAddresses": [
    [
      "name": "",
      "addressId": ""
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
GET Get a passenger
{{baseUrl}}/:passengerId
QUERY PARAMS

passengerId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:passengerId");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/:passengerId")
require "http/client"

url = "{{baseUrl}}/:passengerId"

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}}/:passengerId"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:passengerId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:passengerId"

	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/:passengerId HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:passengerId")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:passengerId"))
    .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}}/:passengerId")
  .get()
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:passengerId")
  .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}}/:passengerId');

xhr.send(data);
import axios from 'axios';

const options = {method: 'GET', url: '{{baseUrl}}/:passengerId'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:passengerId';
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}}/:passengerId',
  method: 'GET',
  headers: {}
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/:passengerId")
  .get()
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/:passengerId',
  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}}/:passengerId'};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/:passengerId');

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}}/:passengerId'};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:passengerId';
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}}/:passengerId"]
                                                       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}}/:passengerId" in

Client.call `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:passengerId",
  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}}/:passengerId');

echo $response->getBody();
setUrl('{{baseUrl}}/:passengerId');
$request->setMethod(HTTP_METH_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/:passengerId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:passengerId' -Method GET 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:passengerId' -Method GET 
import http.client

conn = http.client.HTTPSConnection("example.com")

conn.request("GET", "/baseUrl/:passengerId")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:passengerId"

response = requests.get(url)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:passengerId"

response <- VERB("GET", url, content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/:passengerId")

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/:passengerId') do |req|
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:passengerId";

    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}}/:passengerId
http GET {{baseUrl}}/:passengerId
wget --quiet \
  --method GET \
  --output-document \
  - {{baseUrl}}/:passengerId
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:passengerId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
POST Create a trip
{{baseUrl}}/:passengerId/trip
QUERY PARAMS

passengerId
BODY json

{
  "startAddressId": "",
  "endAddressId": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:passengerId/trip");

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  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/:passengerId/trip" {:content-type :json
                                                              :form-params {:startAddressId ""
                                                                            :endAddressId ""}})
require "http/client"

url = "{{baseUrl}}/:passengerId/trip"
headers = HTTP::Headers{
  "content-type" => "application/json"
}
reqBody = "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\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}}/:passengerId/trip"),
    Content = new StringContent("{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\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}}/:passengerId/trip");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/:passengerId/trip"

	payload := strings.NewReader("{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\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/:passengerId/trip HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 48

{
  "startAddressId": "",
  "endAddressId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:passengerId/trip")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/:passengerId/trip"))
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\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  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/:passengerId/trip")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:passengerId/trip")
  .header("content-type", "application/json")
  .body("{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  startAddressId: '',
  endAddressId: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/:passengerId/trip');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/:passengerId/trip',
  headers: {'content-type': 'application/json'},
  data: {startAddressId: '', endAddressId: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/:passengerId/trip';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"startAddressId":"","endAddressId":""}'
};

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}}/:passengerId/trip',
  method: 'POST',
  headers: {
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "startAddressId": "",\n  "endAddressId": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/:passengerId/trip")
  .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/:passengerId/trip',
  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({startAddressId: '', endAddressId: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/:passengerId/trip',
  headers: {'content-type': 'application/json'},
  body: {startAddressId: '', endAddressId: ''},
  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}}/:passengerId/trip');

req.headers({
  'content-type': 'application/json'
});

req.type('json');
req.send({
  startAddressId: '',
  endAddressId: ''
});

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}}/:passengerId/trip',
  headers: {'content-type': 'application/json'},
  data: {startAddressId: '', endAddressId: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/:passengerId/trip';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json'},
  body: '{"startAddressId":"","endAddressId":""}'
};

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 = @{ @"startAddressId": @"",
                              @"endAddressId": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:passengerId/trip"]
                                                       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}}/:passengerId/trip" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/:passengerId/trip",
  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([
    'startAddressId' => '',
    'endAddressId' => ''
  ]),
  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}}/:passengerId/trip', [
  'body' => '{
  "startAddressId": "",
  "endAddressId": ""
}',
  'headers' => [
    'content-type' => 'application/json',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/:passengerId/trip');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'startAddressId' => '',
  'endAddressId' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'startAddressId' => '',
  'endAddressId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:passengerId/trip');
$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}}/:passengerId/trip' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "startAddressId": "",
  "endAddressId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:passengerId/trip' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "startAddressId": "",
  "endAddressId": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}"

headers = { 'content-type': "application/json" }

conn.request("POST", "/baseUrl/:passengerId/trip", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/:passengerId/trip"

payload = {
    "startAddressId": "",
    "endAddressId": ""
}
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/:passengerId/trip"

payload <- "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\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}}/:passengerId/trip")

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  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\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/:passengerId/trip') do |req|
  req.body = "{\n  \"startAddressId\": \"\",\n  \"endAddressId\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/:passengerId/trip";

    let payload = json!({
        "startAddressId": "",
        "endAddressId": ""
    });

    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}}/:passengerId/trip \
  --header 'content-type: application/json' \
  --data '{
  "startAddressId": "",
  "endAddressId": ""
}'
echo '{
  "startAddressId": "",
  "endAddressId": ""
}' |  \
  http POST {{baseUrl}}/:passengerId/trip \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'content-type: application/json' \
  --body-data '{\n  "startAddressId": "",\n  "endAddressId": ""\n}' \
  --output-document \
  - {{baseUrl}}/:passengerId/trip
import Foundation

let headers = ["content-type": "application/json"]
let parameters = [
  "startAddressId": "",
  "endAddressId": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:passengerId/trip")! 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()