POST Create authentication token
{{baseUrl}}/authentication/token
HEADERS

X-Movary-Client
BODY json

{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

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

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-client: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}");

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

(client/post "{{baseUrl}}/authentication/token" {:headers {:x-movary-client ""}
                                                                 :content-type :json
                                                                 :form-params {:email ""
                                                                               :password ""
                                                                               :totpCode 0
                                                                               :rememberMe false}})
require "http/client"

url = "{{baseUrl}}/authentication/token"
headers = HTTP::Headers{
  "x-movary-client" => ""
  "content-type" => "application/json"
}
reqBody = "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\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}}/authentication/token"),
    Headers =
    {
        { "x-movary-client", "" },
    },
    Content = new StringContent("{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\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}}/authentication/token");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-movary-client", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/authentication/token"

	payload := strings.NewReader("{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-movary-client", "")
	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/authentication/token HTTP/1.1
X-Movary-Client: 
Content-Type: application/json
Host: example.com
Content-Length: 75

{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/authentication/token")
  .setHeader("x-movary-client", "")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/authentication/token"))
    .header("x-movary-client", "")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\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  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/authentication/token")
  .post(body)
  .addHeader("x-movary-client", "")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/authentication/token")
  .header("x-movary-client", "")
  .header("content-type", "application/json")
  .body("{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}")
  .asString();
const data = JSON.stringify({
  email: '',
  password: '',
  totpCode: 0,
  rememberMe: false
});

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

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

xhr.open('POST', '{{baseUrl}}/authentication/token');
xhr.setRequestHeader('x-movary-client', '');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/authentication/token',
  headers: {'x-movary-client': '', 'content-type': 'application/json'},
  data: {email: '', password: '', totpCode: 0, rememberMe: false}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/authentication/token';
const options = {
  method: 'POST',
  headers: {'x-movary-client': '', 'content-type': 'application/json'},
  body: '{"email":"","password":"","totpCode":0,"rememberMe":false}'
};

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}}/authentication/token',
  method: 'POST',
  headers: {
    'x-movary-client': '',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "email": "",\n  "password": "",\n  "totpCode": 0,\n  "rememberMe": false\n}'
};

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

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/authentication/token")
  .post(body)
  .addHeader("x-movary-client", "")
  .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/authentication/token',
  headers: {
    'x-movary-client': '',
    '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({email: '', password: '', totpCode: 0, rememberMe: false}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/authentication/token',
  headers: {'x-movary-client': '', 'content-type': 'application/json'},
  body: {email: '', password: '', totpCode: 0, rememberMe: false},
  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}}/authentication/token');

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

req.type('json');
req.send({
  email: '',
  password: '',
  totpCode: 0,
  rememberMe: false
});

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}}/authentication/token',
  headers: {'x-movary-client': '', 'content-type': 'application/json'},
  data: {email: '', password: '', totpCode: 0, rememberMe: false}
};

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

const url = '{{baseUrl}}/authentication/token';
const options = {
  method: 'POST',
  headers: {'x-movary-client': '', 'content-type': 'application/json'},
  body: '{"email":"","password":"","totpCode":0,"rememberMe":false}'
};

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

NSDictionary *headers = @{ @"x-movary-client": @"",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"email": @"",
                              @"password": @"",
                              @"totpCode": @0,
                              @"rememberMe": @NO };

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/authentication/token"]
                                                       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}}/authentication/token" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-client", "");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/authentication/token",
  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([
    'email' => '',
    'password' => '',
    'totpCode' => 0,
    'rememberMe' => null
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-client: "
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/authentication/token', [
  'body' => '{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-client' => '',
  ],
]);

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

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

$request->setContentType('application/json');
$request->setBody(json_encode([
  'email' => '',
  'password' => '',
  'totpCode' => 0,
  'rememberMe' => null
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'email' => '',
  'password' => '',
  'totpCode' => 0,
  'rememberMe' => null
]));
$request->setRequestUrl('{{baseUrl}}/authentication/token');
$request->setRequestMethod('POST');
$request->setBody($body);

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

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-client", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/authentication/token' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}'
$headers=@{}
$headers.Add("x-movary-client", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/authentication/token' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}'
import http.client

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

payload = "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}"

headers = {
    'x-movary-client': "",
    'content-type': "application/json"
}

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

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

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

url = "{{baseUrl}}/authentication/token"

payload = {
    "email": "",
    "password": "",
    "totpCode": 0,
    "rememberMe": False
}
headers = {
    "x-movary-client": "",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/authentication/token"

payload <- "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('x-movary-client' = ''), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/authentication/token")

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

request = Net::HTTP::Post.new(url)
request["x-movary-client"] = ''
request["content-type"] = 'application/json'
request.body = "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\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/authentication/token') do |req|
  req.headers['x-movary-client'] = ''
  req.body = "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"totpCode\": 0,\n  \"rememberMe\": false\n}"
end

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

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

    let payload = json!({
        "email": "",
        "password": "",
        "totpCode": 0,
        "rememberMe": false
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-client", "".parse().unwrap());
    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}}/authentication/token \
  --header 'content-type: application/json' \
  --header 'x-movary-client: ' \
  --data '{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}'
echo '{
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
}' |  \
  http POST {{baseUrl}}/authentication/token \
  content-type:application/json \
  x-movary-client:''
wget --quiet \
  --method POST \
  --header 'x-movary-client: ' \
  --header 'content-type: application/json' \
  --body-data '{\n  "email": "",\n  "password": "",\n  "totpCode": 0,\n  "rememberMe": false\n}' \
  --output-document \
  - {{baseUrl}}/authentication/token
import Foundation

let headers = [
  "x-movary-client": "",
  "content-type": "application/json"
]
let parameters = [
  "email": "",
  "password": "",
  "totpCode": 0,
  "rememberMe": false
] as [String : Any]

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

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

{
  "error": "ErrorType",
  "message": "This is the error message"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "ErrorType",
  "message": "This is the error message"
}
DELETE Delete authentication token
{{baseUrl}}/authentication/token
HEADERS

X-Movary-Token
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/authentication/token");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

(client/delete "{{baseUrl}}/authentication/token" {:headers {:x-movary-token ""}})
require "http/client"

url = "{{baseUrl}}/authentication/token"
headers = HTTP::Headers{
  "x-movary-token" => ""
}

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

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

func main() {

	url := "{{baseUrl}}/authentication/token"

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

	req.Header.Add("x-movary-token", "")

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

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

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

}
DELETE /baseUrl/authentication/token HTTP/1.1
X-Movary-Token: 
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/authentication/token")
  .setHeader("x-movary-token", "")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/authentication/token"))
    .header("x-movary-token", "")
    .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}}/authentication/token")
  .delete(null)
  .addHeader("x-movary-token", "")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/authentication/token")
  .header("x-movary-token", "")
  .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}}/authentication/token');
xhr.setRequestHeader('x-movary-token', '');

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

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/authentication/token',
  headers: {'x-movary-token': ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/authentication/token';
const options = {method: 'DELETE', headers: {'x-movary-token': ''}};

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}}/authentication/token',
  method: 'DELETE',
  headers: {
    'x-movary-token': ''
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/authentication/token")
  .delete(null)
  .addHeader("x-movary-token", "")
  .build()

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

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/authentication/token',
  headers: {
    'x-movary-token': ''
  }
};

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}}/authentication/token',
  headers: {'x-movary-token': ''}
};

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

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

const req = unirest('DELETE', '{{baseUrl}}/authentication/token');

req.headers({
  'x-movary-token': ''
});

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}}/authentication/token',
  headers: {'x-movary-token': ''}
};

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

const url = '{{baseUrl}}/authentication/token';
const options = {method: 'DELETE', headers: {'x-movary-token': ''}};

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

NSDictionary *headers = @{ @"x-movary-token": @"" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/authentication/token"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];

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}}/authentication/token" in
let headers = Header.add (Header.init ()) "x-movary-token" "" in

Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/authentication/token",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => [
    "x-movary-token: "
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/authentication/token', [
  'headers' => [
    'x-movary-token' => '',
  ],
]);

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

$request->setHeaders([
  'x-movary-token' => ''
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/authentication/token');
$request->setRequestMethod('DELETE');
$request->setHeaders([
  'x-movary-token' => ''
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/authentication/token' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-movary-token", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/authentication/token' -Method DELETE -Headers $headers
import http.client

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

headers = { 'x-movary-token': "" }

conn.request("DELETE", "/baseUrl/authentication/token", headers=headers)

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

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

url = "{{baseUrl}}/authentication/token"

headers = {"x-movary-token": ""}

response = requests.delete(url, headers=headers)

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

url <- "{{baseUrl}}/authentication/token"

response <- VERB("DELETE", url, add_headers('x-movary-token' = ''), content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/authentication/token")

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

request = Net::HTTP::Delete.new(url)
request["x-movary-token"] = ''

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

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

response = conn.delete('/baseUrl/authentication/token') do |req|
  req.headers['x-movary-token'] = ''
end

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

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "".parse().unwrap());

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

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

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/authentication/token \
  --header 'x-movary-token: '
http DELETE {{baseUrl}}/authentication/token \
  x-movary-token:''
wget --quiet \
  --method DELETE \
  --header 'x-movary-token: ' \
  --output-document \
  - {{baseUrl}}/authentication/token
import Foundation

let headers = ["x-movary-token": ""]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/authentication/token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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

{
  "error": "ErrorType",
  "message": "This is the error message"
}
GET Get authentication data
{{baseUrl}}/authentication/token
HEADERS

X-Movary-Token
X-Movary-Token
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/authentication/token");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

(client/get "{{baseUrl}}/authentication/token" {:headers {:x-movary-token "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/authentication/token"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/authentication/token"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/authentication/token");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-movary-token", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/authentication/token"

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

	req.Header.Add("x-movary-token", "{{apiKey}}")

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

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

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

}
GET /baseUrl/authentication/token HTTP/1.1
X-Movary-Token: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/authentication/token")
  .setHeader("x-movary-token", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/authentication/token"))
    .header("x-movary-token", "{{apiKey}}")
    .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}}/authentication/token")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/authentication/token")
  .header("x-movary-token", "{{apiKey}}")
  .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}}/authentication/token');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/authentication/token',
  headers: {'x-movary-token': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/authentication/token';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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}}/authentication/token',
  method: 'GET',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/authentication/token")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build()

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

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/authentication/token',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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}}/authentication/token',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

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

const req = unirest('GET', '{{baseUrl}}/authentication/token');

req.headers({
  'x-movary-token': '{{apiKey}}'
});

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}}/authentication/token',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

const url = '{{baseUrl}}/authentication/token';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/authentication/token"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

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}}/authentication/token" in
let headers = Header.add (Header.init ()) "x-movary-token" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/authentication/token",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/authentication/token', [
  'headers' => [
    'x-movary-token' => '{{apiKey}}',
  ],
]);

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

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/authentication/token');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/authentication/token' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/authentication/token' -Method GET -Headers $headers
import http.client

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

headers = { 'x-movary-token': "{{apiKey}}" }

conn.request("GET", "/baseUrl/authentication/token", headers=headers)

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

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

url = "{{baseUrl}}/authentication/token"

headers = {"x-movary-token": "{{apiKey}}"}

response = requests.get(url, headers=headers)

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

url <- "{{baseUrl}}/authentication/token"

response <- VERB("GET", url, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/authentication/token")

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

request = Net::HTTP::Get.new(url)
request["x-movary-token"] = '{{apiKey}}'

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

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

response = conn.get('/baseUrl/authentication/token') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

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

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/authentication/token \
  --header 'x-movary-token: {{apiKey}}'
http GET {{baseUrl}}/authentication/token \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-movary-token: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/authentication/token
import Foundation

let headers = ["x-movary-token": "{{apiKey}}"]

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

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

{
  "error": "ErrorType",
  "message": "This is the error message"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "ErrorType",
  "message": "This is the error message"
}
POST Add movie play with watch date set to user
{{baseUrl}}/users/:username/history/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0,
    "watchedAt": "",
    "plays": 0,
    "comment": "",
    "position": ""
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/history/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]");

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

(client/post "{{baseUrl}}/users/:username/history/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                           :content-type :json
                                                                           :form-params [{:movaryId 42
                                                                                          :watchedAt "2023-07-02"
                                                                                          :plays 1
                                                                                          :comment "This is a comment"
                                                                                          :position 1}]})
require "http/client"

url = "{{baseUrl}}/users/:username/history/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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}}/users/:username/history/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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}}/users/:username/history/movies");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/history/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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/users/:username/history/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 132

[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/users/:username/history/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/history/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/users/:username/history/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42,
    watchedAt: '2023-07-02',
    plays: 1,
    comment: 'This is a comment',
    position: 1
  }
]);

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

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

xhr.open('POST', '{{baseUrl}}/users/:username/history/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [
    {
      movaryId: 42,
      watchedAt: '2023-07-02',
      plays: 1,
      comment: 'This is a comment',
      position: 1
    }
  ]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/history/movies';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42,"watchedAt":"2023-07-02","plays":1,"comment":"This is a comment","position":1}]'
};

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}}/users/:username/history/movies',
  method: 'POST',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42,\n    "watchedAt": "2023-07-02",\n    "plays": 1,\n    "comment": "This is a comment",\n    "position": 1\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  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .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/users/:username/history/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([
  {
    movaryId: 42,
    watchedAt: '2023-07-02',
    plays: 1,
    comment: 'This is a comment',
    position: 1
  }
]));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [
    {
      movaryId: 42,
      watchedAt: '2023-07-02',
      plays: 1,
      comment: 'This is a comment',
      position: 1
    }
  ],
  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}}/users/:username/history/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42,
    watchedAt: '2023-07-02',
    plays: 1,
    comment: 'This is a comment',
    position: 1
  }
]);

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}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [
    {
      movaryId: 42,
      watchedAt: '2023-07-02',
      plays: 1,
      comment: 'This is a comment',
      position: 1
    }
  ]
};

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

const url = '{{baseUrl}}/users/:username/history/movies';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42,"watchedAt":"2023-07-02","plays":1,"comment":"This is a comment","position":1}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42, @"watchedAt": @"2023-07-02", @"plays": @1, @"comment": @"This is a comment", @"position": @1 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/history/movies"]
                                                       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}}/users/:username/history/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/history/movies",
  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([
    [
        'movaryId' => 42,
        'watchedAt' => '2023-07-02',
        'plays' => 1,
        'comment' => 'This is a comment',
        'position' => 1
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/users/:username/history/movies', [
  'body' => '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/history/movies');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42,
    'watchedAt' => '2023-07-02',
    'plays' => 1,
    'comment' => 'This is a comment',
    'position' => 1
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42,
    'watchedAt' => '2023-07-02',
    'plays' => 1,
    'comment' => 'This is a comment',
    'position' => 1
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/history/movies');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/history/movies' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/history/movies' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/users/:username/history/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/history/movies"

payload = [
    {
        "movaryId": 42,
        "watchedAt": "2023-07-02",
        "plays": 1,
        "comment": "This is a comment",
        "position": 1
    }
]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/history/movies"

payload <- "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/history/movies")

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

request = Net::HTTP::Post.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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/users/:username/history/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"
end

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

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

    let payload = (
        json!({
            "movaryId": 42,
            "watchedAt": "2023-07-02",
            "plays": 1,
            "comment": "This is a comment",
            "position": 1
        })
    );

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    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}}/users/:username/history/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]'
echo '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]' |  \
  http POST {{baseUrl}}/users/:username/history/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42,\n    "watchedAt": "2023-07-02",\n    "plays": 1,\n    "comment": "This is a comment",\n    "position": 1\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/history/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  [
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/history/movies")! 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 movie watch dates from user history
{{baseUrl}}/users/:username/history/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0,
    "watchedAt": ""
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/history/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]");

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

(client/delete "{{baseUrl}}/users/:username/history/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                             :content-type :json
                                                                             :form-params [{:movaryId 42
                                                                                            :watchedAt "2023-07-02"}]})
require "http/client"

url = "{{baseUrl}}/users/:username/history/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]"

response = HTTP::Client.delete url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/users/:username/history/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\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}}/users/:username/history/movies");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/history/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]")

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

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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))

}
DELETE /baseUrl/users/:username/history/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 61

[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/users/:username/history/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/history/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("DELETE", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\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  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .delete(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/users/:username/history/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42,
    watchedAt: '2023-07-02'
  }
]);

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

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

xhr.open('DELETE', '{{baseUrl}}/users/:username/history/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42, watchedAt: '2023-07-02'}]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/history/movies';
const options = {
  method: 'DELETE',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42,"watchedAt":"2023-07-02"}]'
};

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}}/users/:username/history/movies',
  method: 'DELETE',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42,\n    "watchedAt": "2023-07-02"\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  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .delete(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

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

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/history/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([{movaryId: 42, watchedAt: '2023-07-02'}]));
req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [{movaryId: 42, watchedAt: '2023-07-02'}],
  json: true
};

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

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

const req = unirest('DELETE', '{{baseUrl}}/users/:username/history/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42,
    watchedAt: '2023-07-02'
  }
]);

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}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42, watchedAt: '2023-07-02'}]
};

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

const url = '{{baseUrl}}/users/:username/history/movies';
const options = {
  method: 'DELETE',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42,"watchedAt":"2023-07-02"}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42, @"watchedAt": @"2023-07-02" } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/history/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[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}}/users/:username/history/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]" in

Client.call ~headers ~body `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/history/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => json_encode([
    [
        'movaryId' => 42,
        'watchedAt' => '2023-07-02'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/users/:username/history/movies', [
  'body' => '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/history/movies');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42,
    'watchedAt' => '2023-07-02'
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42,
    'watchedAt' => '2023-07-02'
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/history/movies');
$request->setRequestMethod('DELETE');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/history/movies' -Method DELETE -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/history/movies' -Method DELETE -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("DELETE", "/baseUrl/users/:username/history/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/history/movies"

payload = [
    {
        "movaryId": 42,
        "watchedAt": "2023-07-02"
    }
]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/history/movies"

payload <- "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]"

encode <- "json"

response <- VERB("DELETE", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/history/movies")

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

request = Net::HTTP::Delete.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\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.delete('/baseUrl/users/:username/history/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\"\n  }\n]"
end

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

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

    let payload = (
        json!({
            "movaryId": 42,
            "watchedAt": "2023-07-02"
        })
    );

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

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

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

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/users/:username/history/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  }
]'
echo '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  }
]' |  \
  http DELETE {{baseUrl}}/users/:username/history/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method DELETE \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42,\n    "watchedAt": "2023-07-02"\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/history/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  [
    "movaryId": 42,
    "watchedAt": "2023-07-02"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/history/movies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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 played movies with watch dates of user
{{baseUrl}}/users/:username/history/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/history/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

(client/get "{{baseUrl}}/users/:username/history/movies" {:headers {:x-movary-token "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/users/:username/history/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/users/:username/history/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/users/:username/history/movies");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-movary-token", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/history/movies"

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

	req.Header.Add("x-movary-token", "{{apiKey}}")

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

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

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

}
GET /baseUrl/users/:username/history/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/users/:username/history/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/history/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .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}}/users/:username/history/movies")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/users/:username/history/movies")
  .header("x-movary-token", "{{apiKey}}")
  .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}}/users/:username/history/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/history/movies';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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}}/users/:username/history/movies',
  method: 'GET',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build()

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

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/history/movies',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

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

const req = unirest('GET', '{{baseUrl}}/users/:username/history/movies');

req.headers({
  'x-movary-token': '{{apiKey}}'
});

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}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

const url = '{{baseUrl}}/users/:username/history/movies';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/history/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

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}}/users/:username/history/movies" in
let headers = Header.add (Header.init ()) "x-movary-token" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/history/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/users/:username/history/movies', [
  'headers' => [
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/history/movies');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/users/:username/history/movies');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/history/movies' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/history/movies' -Method GET -Headers $headers
import http.client

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

headers = { 'x-movary-token': "{{apiKey}}" }

conn.request("GET", "/baseUrl/users/:username/history/movies", headers=headers)

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

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

url = "{{baseUrl}}/users/:username/history/movies"

headers = {"x-movary-token": "{{apiKey}}"}

response = requests.get(url, headers=headers)

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

url <- "{{baseUrl}}/users/:username/history/movies"

response <- VERB("GET", url, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/users/:username/history/movies")

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

request = Net::HTTP::Get.new(url)
request["x-movary-token"] = '{{apiKey}}'

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

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

response = conn.get('/baseUrl/users/:username/history/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

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

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/users/:username/history/movies \
  --header 'x-movary-token: {{apiKey}}'
http GET {{baseUrl}}/users/:username/history/movies \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-movary-token: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/users/:username/history/movies
import Foundation

let headers = ["x-movary-token": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/history/movies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

{
  "currentPage": 1,
  "maxPage": 10
}
PUT Replace movie play with watch date set for user
{{baseUrl}}/users/:username/history/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0,
    "watchedAt": "",
    "plays": 0,
    "comment": "",
    "position": ""
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/history/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]");

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

(client/put "{{baseUrl}}/users/:username/history/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                          :content-type :json
                                                                          :form-params [{:movaryId 42
                                                                                         :watchedAt "2023-07-02"
                                                                                         :plays 1
                                                                                         :comment "This is a comment"
                                                                                         :position 1}]})
require "http/client"

url = "{{baseUrl}}/users/:username/history/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"

response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Put,
    RequestUri = new Uri("{{baseUrl}}/users/:username/history/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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}}/users/:username/history/movies");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/history/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("x-movary-token", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

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

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

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

}
PUT /baseUrl/users/:username/history/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 132

[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/users/:username/history/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/history/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("PUT", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .put(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/users/:username/history/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42,
    watchedAt: '2023-07-02',
    plays: 1,
    comment: 'This is a comment',
    position: 1
  }
]);

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

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

xhr.open('PUT', '{{baseUrl}}/users/:username/history/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [
    {
      movaryId: 42,
      watchedAt: '2023-07-02',
      plays: 1,
      comment: 'This is a comment',
      position: 1
    }
  ]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/history/movies';
const options = {
  method: 'PUT',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42,"watchedAt":"2023-07-02","plays":1,"comment":"This is a comment","position":1}]'
};

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}}/users/:username/history/movies',
  method: 'PUT',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42,\n    "watchedAt": "2023-07-02",\n    "plays": 1,\n    "comment": "This is a comment",\n    "position": 1\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  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/history/movies")
  .put(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

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

const options = {
  method: 'PUT',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/history/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([
  {
    movaryId: 42,
    watchedAt: '2023-07-02',
    plays: 1,
    comment: 'This is a comment',
    position: 1
  }
]));
req.end();
const request = require('request');

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [
    {
      movaryId: 42,
      watchedAt: '2023-07-02',
      plays: 1,
      comment: 'This is a comment',
      position: 1
    }
  ],
  json: true
};

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

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

const req = unirest('PUT', '{{baseUrl}}/users/:username/history/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42,
    watchedAt: '2023-07-02',
    plays: 1,
    comment: 'This is a comment',
    position: 1
  }
]);

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

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

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/users/:username/history/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [
    {
      movaryId: 42,
      watchedAt: '2023-07-02',
      plays: 1,
      comment: 'This is a comment',
      position: 1
    }
  ]
};

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

const url = '{{baseUrl}}/users/:username/history/movies';
const options = {
  method: 'PUT',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42,"watchedAt":"2023-07-02","plays":1,"comment":"This is a comment","position":1}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42, @"watchedAt": @"2023-07-02", @"plays": @1, @"comment": @"This is a comment", @"position": @1 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/history/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

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

let uri = Uri.of_string "{{baseUrl}}/users/:username/history/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]" in

Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/history/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    [
        'movaryId' => 42,
        'watchedAt' => '2023-07-02',
        'plays' => 1,
        'comment' => 'This is a comment',
        'position' => 1
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('PUT', '{{baseUrl}}/users/:username/history/movies', [
  'body' => '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/history/movies');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42,
    'watchedAt' => '2023-07-02',
    'plays' => 1,
    'comment' => 'This is a comment',
    'position' => 1
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42,
    'watchedAt' => '2023-07-02',
    'plays' => 1,
    'comment' => 'This is a comment',
    'position' => 1
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/history/movies');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/history/movies' -Method PUT -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/history/movies' -Method PUT -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("PUT", "/baseUrl/users/:username/history/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/history/movies"

payload = [
    {
        "movaryId": 42,
        "watchedAt": "2023-07-02",
        "plays": 1,
        "comment": "This is a comment",
        "position": 1
    }
]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/history/movies"

payload <- "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"

encode <- "json"

response <- VERB("PUT", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/history/movies")

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

request = Net::HTTP::Put.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\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.put('/baseUrl/users/:username/history/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42,\n    \"watchedAt\": \"2023-07-02\",\n    \"plays\": 1,\n    \"comment\": \"This is a comment\",\n    \"position\": 1\n  }\n]"
end

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

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

    let payload = (
        json!({
            "movaryId": 42,
            "watchedAt": "2023-07-02",
            "plays": 1,
            "comment": "This is a comment",
            "position": 1
        })
    );

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

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

    dbg!(results);
}
curl --request PUT \
  --url {{baseUrl}}/users/:username/history/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]'
echo '[
  {
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  }
]' |  \
  http PUT {{baseUrl}}/users/:username/history/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method PUT \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42,\n    "watchedAt": "2023-07-02",\n    "plays": 1,\n    "comment": "This is a comment",\n    "position": 1\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/history/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  [
    "movaryId": 42,
    "watchedAt": "2023-07-02",
    "plays": 1,
    "comment": "This is a comment",
    "position": 1
  ]
] as [String : Any]

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

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

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

dataTask.resume()
POST Add movie via external provider id
{{baseUrl}}/movies/add
HEADERS

X-Movary-Token
{{apiKey}}
BODY json

{
  "tmdbId": 0
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

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

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"tmdbId\": 0\n}");

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

(client/post "{{baseUrl}}/movies/add" {:headers {:x-movary-token "{{apiKey}}"}
                                                       :content-type :json
                                                       :form-params {:tmdbId 0}})
require "http/client"

url = "{{baseUrl}}/movies/add"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"tmdbId\": 0\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/movies/add"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"tmdbId\": 0\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/movies/add");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"tmdbId\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/movies/add"

	payload := strings.NewReader("{\n  \"tmdbId\": 0\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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/movies/add HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 17

{
  "tmdbId": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/movies/add")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"tmdbId\": 0\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/movies/add"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"tmdbId\": 0\n}"))
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"tmdbId\": 0\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/movies/add")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/movies/add")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"tmdbId\": 0\n}")
  .asString();
const data = JSON.stringify({
  tmdbId: 0
});

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

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

xhr.open('POST', '{{baseUrl}}/movies/add');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/movies/add',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: {tmdbId: 0}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/movies/add';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"tmdbId":0}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/movies/add',
  method: 'POST',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "tmdbId": 0\n}'
};

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

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"tmdbId\": 0\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/movies/add")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .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/movies/add',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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({tmdbId: 0}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/movies/add',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: {tmdbId: 0},
  json: true
};

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

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

const req = unirest('POST', '{{baseUrl}}/movies/add');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  tmdbId: 0
});

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

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/movies/add',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: {tmdbId: 0}
};

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

const url = '{{baseUrl}}/movies/add';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '{"tmdbId":0}'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tmdbId": @0 };

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/movies/add"]
                                                       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}}/movies/add" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"tmdbId\": 0\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/movies/add",
  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([
    'tmdbId' => 0
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/movies/add', [
  'body' => '{
  "tmdbId": 0
}',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

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

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'tmdbId' => 0
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'tmdbId' => 0
]));
$request->setRequestUrl('{{baseUrl}}/movies/add');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/movies/add' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "tmdbId": 0
}'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/movies/add' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "tmdbId": 0
}'
import http.client

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

payload = "{\n  \"tmdbId\": 0\n}"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

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

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

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

url = "{{baseUrl}}/movies/add"

payload = { "tmdbId": 0 }
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/movies/add"

payload <- "{\n  \"tmdbId\": 0\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/movies/add")

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

request = Net::HTTP::Post.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"tmdbId\": 0\n}"

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

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/movies/add') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "{\n  \"tmdbId\": 0\n}"
end

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

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

    let payload = json!({"tmdbId": 0});

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    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}}/movies/add \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '{
  "tmdbId": 0
}'
echo '{
  "tmdbId": 0
}' |  \
  http POST {{baseUrl}}/movies/add \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "tmdbId": 0\n}' \
  --output-document \
  - {{baseUrl}}/movies/add
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = ["tmdbId": 0] as [String : Any]

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

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

{
  "movaryId": 42
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "ErrorType",
  "message": "This is the error message"
}
GET Search for movies remotely
{{baseUrl}}/movies/search
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

search
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/movies/search?search=");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

(client/get "{{baseUrl}}/movies/search" {:headers {:x-movary-token "{{apiKey}}"}
                                                         :query-params {:search ""}})
require "http/client"

url = "{{baseUrl}}/movies/search?search="
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/movies/search?search="),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/movies/search?search=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-movary-token", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/movies/search?search="

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

	req.Header.Add("x-movary-token", "{{apiKey}}")

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

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

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

}
GET /baseUrl/movies/search?search= HTTP/1.1
X-Movary-Token: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/movies/search?search=")
  .setHeader("x-movary-token", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/movies/search?search="))
    .header("x-movary-token", "{{apiKey}}")
    .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}}/movies/search?search=")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/movies/search?search=")
  .header("x-movary-token", "{{apiKey}}")
  .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}}/movies/search?search=');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/movies/search',
  params: {search: ''},
  headers: {'x-movary-token': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/movies/search?search=';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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}}/movies/search?search=',
  method: 'GET',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/movies/search?search=")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build()

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

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/movies/search?search=',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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}}/movies/search',
  qs: {search: ''},
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

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

const req = unirest('GET', '{{baseUrl}}/movies/search');

req.query({
  search: ''
});

req.headers({
  'x-movary-token': '{{apiKey}}'
});

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}}/movies/search',
  params: {search: ''},
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

const url = '{{baseUrl}}/movies/search?search=';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/movies/search?search="]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

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}}/movies/search?search=" in
let headers = Header.add (Header.init ()) "x-movary-token" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/movies/search?search=",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/movies/search?search=', [
  'headers' => [
    'x-movary-token' => '{{apiKey}}',
  ],
]);

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

$request->setQueryData([
  'search' => ''
]);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/movies/search');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
  'search' => ''
]));

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/movies/search?search=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/movies/search?search=' -Method GET -Headers $headers
import http.client

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

headers = { 'x-movary-token': "{{apiKey}}" }

conn.request("GET", "/baseUrl/movies/search?search=", headers=headers)

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

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

url = "{{baseUrl}}/movies/search"

querystring = {"search":""}

headers = {"x-movary-token": "{{apiKey}}"}

response = requests.get(url, headers=headers, params=querystring)

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

url <- "{{baseUrl}}/movies/search"

queryString <- list(search = "")

response <- VERB("GET", url, query = queryString, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/movies/search?search=")

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

request = Net::HTTP::Get.new(url)
request["x-movary-token"] = '{{apiKey}}'

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

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

response = conn.get('/baseUrl/movies/search') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.params['search'] = ''
end

puts response.status
puts response.body
use reqwest;

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

    let querystring = [
        ("search", ""),
    ];

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .query(&querystring)
        .headers(headers)
        .send()
        .await;

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

    dbg!(results);
}
curl --request GET \
  --url '{{baseUrl}}/movies/search?search=' \
  --header 'x-movary-token: {{apiKey}}'
http GET '{{baseUrl}}/movies/search?search=' \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-movary-token: {{apiKey}}' \
  --output-document \
  - '{{baseUrl}}/movies/search?search='
import Foundation

let headers = ["x-movary-token": "{{apiKey}}"]

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

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

{
  "currentPage": 1,
  "maxPage": 10
}
POST Add movie plays to user
{{baseUrl}}/users/:username/played/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0,
    "watchDates": [
      {
        "watchedAt": "",
        "plays": 0,
        "comment": ""
      }
    ]
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/played/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42\n  }\n]");

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

(client/post "{{baseUrl}}/users/:username/played/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                          :content-type :json
                                                                          :form-params [{:movaryId 42}]})
require "http/client"

url = "{{baseUrl}}/users/:username/played/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42\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}}/users/:username/played/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42\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}}/users/:username/played/movies");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/played/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42\n  }\n]")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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/users/:username/played/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30

[
  {
    "movaryId": 42
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/users/:username/played/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/played/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42\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  {\n    \"movaryId\": 42\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/users/:username/played/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42
  }
]);

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

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

xhr.open('POST', '{{baseUrl}}/users/:username/played/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/played/movies';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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}}/users/:username/played/movies',
  method: 'POST',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42\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  {\n    \"movaryId\": 42\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .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/users/:username/played/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([{movaryId: 42}]));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [{movaryId: 42}],
  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}}/users/:username/played/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42
  }
]);

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}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

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

const url = '{{baseUrl}}/users/:username/played/movies';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/played/movies"]
                                                       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}}/users/:username/played/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42\n  }\n]" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/played/movies",
  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([
    [
        'movaryId' => 42
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/users/:username/played/movies', [
  'body' => '[
  {
    "movaryId": 42
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/played/movies');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/played/movies');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/played/movies' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/played/movies' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/users/:username/played/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/played/movies"

payload = [{ "movaryId": 42 }]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/played/movies"

payload <- "[\n  {\n    \"movaryId\": 42\n  }\n]"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/played/movies")

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

request = Net::HTTP::Post.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42\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/users/:username/played/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42\n  }\n]"
end

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

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

    let payload = (json!({"movaryId": 42}));

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    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}}/users/:username/played/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42
  }
]'
echo '[
  {
    "movaryId": 42
  }
]' |  \
  http POST {{baseUrl}}/users/:username/played/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/played/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [["movaryId": 42]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/played/movies")! 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 movie plays from user
{{baseUrl}}/users/:username/played/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0,
    "watchDates": []
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/played/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42\n  }\n]");

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

(client/delete "{{baseUrl}}/users/:username/played/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                            :content-type :json
                                                                            :form-params [{:movaryId 42}]})
require "http/client"

url = "{{baseUrl}}/users/:username/played/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42\n  }\n]"

response = HTTP::Client.delete url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/users/:username/played/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42\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}}/users/:username/played/movies");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/played/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42\n  }\n]")

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

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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))

}
DELETE /baseUrl/users/:username/played/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30

[
  {
    "movaryId": 42
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/users/:username/played/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/played/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("DELETE", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42\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  {\n    \"movaryId\": 42\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .delete(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/users/:username/played/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42
  }
]);

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

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

xhr.open('DELETE', '{{baseUrl}}/users/:username/played/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/played/movies';
const options = {
  method: 'DELETE',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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}}/users/:username/played/movies',
  method: 'DELETE',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42\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  {\n    \"movaryId\": 42\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .delete(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

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

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/played/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([{movaryId: 42}]));
req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [{movaryId: 42}],
  json: true
};

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

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

const req = unirest('DELETE', '{{baseUrl}}/users/:username/played/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42
  }
]);

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}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

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

const url = '{{baseUrl}}/users/:username/played/movies';
const options = {
  method: 'DELETE',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/played/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[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}}/users/:username/played/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42\n  }\n]" in

Client.call ~headers ~body `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/played/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => json_encode([
    [
        'movaryId' => 42
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/users/:username/played/movies', [
  'body' => '[
  {
    "movaryId": 42
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/played/movies');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/played/movies');
$request->setRequestMethod('DELETE');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/played/movies' -Method DELETE -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/played/movies' -Method DELETE -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("DELETE", "/baseUrl/users/:username/played/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/played/movies"

payload = [{ "movaryId": 42 }]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/played/movies"

payload <- "[\n  {\n    \"movaryId\": 42\n  }\n]"

encode <- "json"

response <- VERB("DELETE", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/played/movies")

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

request = Net::HTTP::Delete.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42\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.delete('/baseUrl/users/:username/played/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42\n  }\n]"
end

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

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

    let payload = (json!({"movaryId": 42}));

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

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

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

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/users/:username/played/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42
  }
]'
echo '[
  {
    "movaryId": 42
  }
]' |  \
  http DELETE {{baseUrl}}/users/:username/played/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method DELETE \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/played/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [["movaryId": 42]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/played/movies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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 played movies of user
{{baseUrl}}/users/:username/played/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/played/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

(client/get "{{baseUrl}}/users/:username/played/movies" {:headers {:x-movary-token "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/users/:username/played/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/users/:username/played/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/users/:username/played/movies");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-movary-token", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/played/movies"

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

	req.Header.Add("x-movary-token", "{{apiKey}}")

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

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

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

}
GET /baseUrl/users/:username/played/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/users/:username/played/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/played/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .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}}/users/:username/played/movies")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/users/:username/played/movies")
  .header("x-movary-token", "{{apiKey}}")
  .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}}/users/:username/played/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/played/movies';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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}}/users/:username/played/movies',
  method: 'GET',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build()

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

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/played/movies',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

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

const req = unirest('GET', '{{baseUrl}}/users/:username/played/movies');

req.headers({
  'x-movary-token': '{{apiKey}}'
});

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}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

const url = '{{baseUrl}}/users/:username/played/movies';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/played/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

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}}/users/:username/played/movies" in
let headers = Header.add (Header.init ()) "x-movary-token" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/played/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/users/:username/played/movies', [
  'headers' => [
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/played/movies');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/users/:username/played/movies');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/played/movies' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/played/movies' -Method GET -Headers $headers
import http.client

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

headers = { 'x-movary-token': "{{apiKey}}" }

conn.request("GET", "/baseUrl/users/:username/played/movies", headers=headers)

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

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

url = "{{baseUrl}}/users/:username/played/movies"

headers = {"x-movary-token": "{{apiKey}}"}

response = requests.get(url, headers=headers)

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

url <- "{{baseUrl}}/users/:username/played/movies"

response <- VERB("GET", url, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/users/:username/played/movies")

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

request = Net::HTTP::Get.new(url)
request["x-movary-token"] = '{{apiKey}}'

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

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

response = conn.get('/baseUrl/users/:username/played/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

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

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/users/:username/played/movies \
  --header 'x-movary-token: {{apiKey}}'
http GET {{baseUrl}}/users/:username/played/movies \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-movary-token: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/users/:username/played/movies
import Foundation

let headers = ["x-movary-token": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/played/movies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

{
  "currentPage": 1,
  "maxPage": 10
}
PUT Replace movie plays for user
{{baseUrl}}/users/:username/played/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0,
    "watchDates": [
      {
        "watchedAt": "",
        "plays": 0,
        "comment": ""
      }
    ]
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/played/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42\n  }\n]");

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

(client/put "{{baseUrl}}/users/:username/played/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                         :content-type :json
                                                                         :form-params [{:movaryId 42}]})
require "http/client"

url = "{{baseUrl}}/users/:username/played/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42\n  }\n]"

response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Put,
    RequestUri = new Uri("{{baseUrl}}/users/:username/played/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42\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}}/users/:username/played/movies");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/played/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42\n  }\n]")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("x-movary-token", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

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

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

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

}
PUT /baseUrl/users/:username/played/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30

[
  {
    "movaryId": 42
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/users/:username/played/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/played/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("PUT", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42\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  {\n    \"movaryId\": 42\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .put(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/users/:username/played/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42
  }
]);

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

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

xhr.open('PUT', '{{baseUrl}}/users/:username/played/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/played/movies';
const options = {
  method: 'PUT',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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}}/users/:username/played/movies',
  method: 'PUT',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42\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  {\n    \"movaryId\": 42\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/played/movies")
  .put(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

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

const options = {
  method: 'PUT',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/played/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([{movaryId: 42}]));
req.end();
const request = require('request');

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [{movaryId: 42}],
  json: true
};

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

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

const req = unirest('PUT', '{{baseUrl}}/users/:username/played/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42
  }
]);

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

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

const options = {
  method: 'PUT',
  url: '{{baseUrl}}/users/:username/played/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

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

const url = '{{baseUrl}}/users/:username/played/movies';
const options = {
  method: 'PUT',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/played/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

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

let uri = Uri.of_string "{{baseUrl}}/users/:username/played/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42\n  }\n]" in

Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/played/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    [
        'movaryId' => 42
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('PUT', '{{baseUrl}}/users/:username/played/movies', [
  'body' => '[
  {
    "movaryId": 42
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/played/movies');
$request->setMethod(HTTP_METH_PUT);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/played/movies');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/played/movies' -Method PUT -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/played/movies' -Method PUT -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("PUT", "/baseUrl/users/:username/played/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/played/movies"

payload = [{ "movaryId": 42 }]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/played/movies"

payload <- "[\n  {\n    \"movaryId\": 42\n  }\n]"

encode <- "json"

response <- VERB("PUT", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/played/movies")

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

request = Net::HTTP::Put.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42\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.put('/baseUrl/users/:username/played/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42\n  }\n]"
end

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

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

    let payload = (json!({"movaryId": 42}));

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

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

    dbg!(results);
}
curl --request PUT \
  --url {{baseUrl}}/users/:username/played/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42
  }
]'
echo '[
  {
    "movaryId": 42
  }
]' |  \
  http PUT {{baseUrl}}/users/:username/played/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method PUT \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/played/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [["movaryId": 42]] as [String : Any]

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

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

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

dataTask.resume()
POST Add movie to watchlist of user
{{baseUrl}}/users/:username/watchlist/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/watchlist/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42\n  }\n]");

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

(client/post "{{baseUrl}}/users/:username/watchlist/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                             :content-type :json
                                                                             :form-params [{:movaryId 42}]})
require "http/client"

url = "{{baseUrl}}/users/:username/watchlist/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42\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}}/users/:username/watchlist/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42\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}}/users/:username/watchlist/movies");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/watchlist/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42\n  }\n]")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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/users/:username/watchlist/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30

[
  {
    "movaryId": 42
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/users/:username/watchlist/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/watchlist/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42\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  {\n    \"movaryId\": 42\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/watchlist/movies")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/users/:username/watchlist/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42
  }
]);

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

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

xhr.open('POST', '{{baseUrl}}/users/:username/watchlist/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/watchlist/movies';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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}}/users/:username/watchlist/movies',
  method: 'POST',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42\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  {\n    \"movaryId\": 42\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/watchlist/movies")
  .post(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .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/users/:username/watchlist/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([{movaryId: 42}]));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [{movaryId: 42}],
  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}}/users/:username/watchlist/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42
  }
]);

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}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

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

const url = '{{baseUrl}}/users/:username/watchlist/movies';
const options = {
  method: 'POST',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/watchlist/movies"]
                                                       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}}/users/:username/watchlist/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42\n  }\n]" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/watchlist/movies",
  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([
    [
        'movaryId' => 42
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/users/:username/watchlist/movies', [
  'body' => '[
  {
    "movaryId": 42
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/watchlist/movies');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/watchlist/movies');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/watchlist/movies' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/watchlist/movies' -Method POST -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/users/:username/watchlist/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/watchlist/movies"

payload = [{ "movaryId": 42 }]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/watchlist/movies"

payload <- "[\n  {\n    \"movaryId\": 42\n  }\n]"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/watchlist/movies")

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

request = Net::HTTP::Post.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42\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/users/:username/watchlist/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42\n  }\n]"
end

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

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

    let payload = (json!({"movaryId": 42}));

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    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}}/users/:username/watchlist/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42
  }
]'
echo '[
  {
    "movaryId": 42
  }
]' |  \
  http POST {{baseUrl}}/users/:username/watchlist/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/watchlist/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [["movaryId": 42]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/watchlist/movies")! 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 movie from watchlist of user
{{baseUrl}}/users/:username/watchlist/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
BODY json

[
  {
    "movaryId": 0
  }
]
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/watchlist/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "[\n  {\n    \"movaryId\": 42\n  }\n]");

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

(client/delete "{{baseUrl}}/users/:username/watchlist/movies" {:headers {:x-movary-token "{{apiKey}}"}
                                                                               :content-type :json
                                                                               :form-params [{:movaryId 42}]})
require "http/client"

url = "{{baseUrl}}/users/:username/watchlist/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "[\n  {\n    \"movaryId\": 42\n  }\n]"

response = HTTP::Client.delete url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/users/:username/watchlist/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
    Content = new StringContent("[\n  {\n    \"movaryId\": 42\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}}/users/:username/watchlist/movies");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-movary-token", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"movaryId\": 42\n  }\n]", ParameterType.RequestBody);
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/watchlist/movies"

	payload := strings.NewReader("[\n  {\n    \"movaryId\": 42\n  }\n]")

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

	req.Header.Add("x-movary-token", "{{apiKey}}")
	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))

}
DELETE /baseUrl/users/:username/watchlist/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 30

[
  {
    "movaryId": 42
  }
]
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/users/:username/watchlist/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/watchlist/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("DELETE", HttpRequest.BodyPublishers.ofString("[\n  {\n    \"movaryId\": 42\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  {\n    \"movaryId\": 42\n  }\n]");
Request request = new Request.Builder()
  .url("{{baseUrl}}/users/:username/watchlist/movies")
  .delete(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/users/:username/watchlist/movies")
  .header("x-movary-token", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("[\n  {\n    \"movaryId\": 42\n  }\n]")
  .asString();
const data = JSON.stringify([
  {
    movaryId: 42
  }
]);

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

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

xhr.open('DELETE', '{{baseUrl}}/users/:username/watchlist/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

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

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/watchlist/movies';
const options = {
  method: 'DELETE',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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}}/users/:username/watchlist/movies',
  method: 'DELETE',
  headers: {
    'x-movary-token': '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '[\n  {\n    "movaryId": 42\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  {\n    \"movaryId\": 42\n  }\n]")
val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/watchlist/movies")
  .delete(body)
  .addHeader("x-movary-token", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

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

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/watchlist/movies',
  headers: {
    'x-movary-token': '{{apiKey}}',
    '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([{movaryId: 42}]));
req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: [{movaryId: 42}],
  json: true
};

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

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

const req = unirest('DELETE', '{{baseUrl}}/users/:username/watchlist/movies');

req.headers({
  'x-movary-token': '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send([
  {
    movaryId: 42
  }
]);

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}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  data: [{movaryId: 42}]
};

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

const url = '{{baseUrl}}/users/:username/watchlist/movies';
const options = {
  method: 'DELETE',
  headers: {'x-movary-token': '{{apiKey}}', 'content-type': 'application/json'},
  body: '[{"movaryId":42}]'
};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @[ @{ @"movaryId": @42 } ];

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

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/watchlist/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[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}}/users/:username/watchlist/movies" in
let headers = Header.add_list (Header.init ()) [
  ("x-movary-token", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "[\n  {\n    \"movaryId\": 42\n  }\n]" in

Client.call ~headers ~body `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/watchlist/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => json_encode([
    [
        'movaryId' => 42
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/users/:username/watchlist/movies', [
  'body' => '[
  {
    "movaryId": 42
  }
]',
  'headers' => [
    'content-type' => 'application/json',
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/watchlist/movies');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  [
    'movaryId' => 42
  ]
]));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  [
    'movaryId' => 42
  ]
]));
$request->setRequestUrl('{{baseUrl}}/users/:username/watchlist/movies');
$request->setRequestMethod('DELETE');
$request->setBody($body);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/watchlist/movies' -Method DELETE -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/watchlist/movies' -Method DELETE -Headers $headers -ContentType 'application/json' -Body '[
  {
    "movaryId": 42
  }
]'
import http.client

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

payload = "[\n  {\n    \"movaryId\": 42\n  }\n]"

headers = {
    'x-movary-token': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("DELETE", "/baseUrl/users/:username/watchlist/movies", payload, headers)

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

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

url = "{{baseUrl}}/users/:username/watchlist/movies"

payload = [{ "movaryId": 42 }]
headers = {
    "x-movary-token": "{{apiKey}}",
    "content-type": "application/json"
}

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

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

url <- "{{baseUrl}}/users/:username/watchlist/movies"

payload <- "[\n  {\n    \"movaryId\": 42\n  }\n]"

encode <- "json"

response <- VERB("DELETE", url, body = payload, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/json"), encode = encode)

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

url = URI("{{baseUrl}}/users/:username/watchlist/movies")

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

request = Net::HTTP::Delete.new(url)
request["x-movary-token"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "[\n  {\n    \"movaryId\": 42\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.delete('/baseUrl/users/:username/watchlist/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
  req.body = "[\n  {\n    \"movaryId\": 42\n  }\n]"
end

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

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

    let payload = (json!({"movaryId": 42}));

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

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

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

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/users/:username/watchlist/movies \
  --header 'content-type: application/json' \
  --header 'x-movary-token: {{apiKey}}' \
  --data '[
  {
    "movaryId": 42
  }
]'
echo '[
  {
    "movaryId": 42
  }
]' |  \
  http DELETE {{baseUrl}}/users/:username/watchlist/movies \
  content-type:application/json \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method DELETE \
  --header 'x-movary-token: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '[\n  {\n    "movaryId": 42\n  }\n]' \
  --output-document \
  - {{baseUrl}}/users/:username/watchlist/movies
import Foundation

let headers = [
  "x-movary-token": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [["movaryId": 42]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/watchlist/movies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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 movies in watchlist of user
{{baseUrl}}/users/:username/watchlist/movies
HEADERS

X-Movary-Token
{{apiKey}}
QUERY PARAMS

username
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/users/:username/watchlist/movies");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-movary-token: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

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

(client/get "{{baseUrl}}/users/:username/watchlist/movies" {:headers {:x-movary-token "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/users/:username/watchlist/movies"
headers = HTTP::Headers{
  "x-movary-token" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/users/:username/watchlist/movies"),
    Headers =
    {
        { "x-movary-token", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/users/:username/watchlist/movies");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-movary-token", "{{apiKey}}");
var response = client.Execute(request);
package main

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

func main() {

	url := "{{baseUrl}}/users/:username/watchlist/movies"

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

	req.Header.Add("x-movary-token", "{{apiKey}}")

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

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

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

}
GET /baseUrl/users/:username/watchlist/movies HTTP/1.1
X-Movary-Token: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/users/:username/watchlist/movies")
  .setHeader("x-movary-token", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/users/:username/watchlist/movies"))
    .header("x-movary-token", "{{apiKey}}")
    .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}}/users/:username/watchlist/movies")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/users/:username/watchlist/movies")
  .header("x-movary-token", "{{apiKey}}")
  .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}}/users/:username/watchlist/movies');
xhr.setRequestHeader('x-movary-token', '{{apiKey}}');

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

const options = {
  method: 'GET',
  url: '{{baseUrl}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/users/:username/watchlist/movies';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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}}/users/:username/watchlist/movies',
  method: 'GET',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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

val request = Request.Builder()
  .url("{{baseUrl}}/users/:username/watchlist/movies")
  .get()
  .addHeader("x-movary-token", "{{apiKey}}")
  .build()

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

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/users/:username/watchlist/movies',
  headers: {
    'x-movary-token': '{{apiKey}}'
  }
};

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}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

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

const req = unirest('GET', '{{baseUrl}}/users/:username/watchlist/movies');

req.headers({
  'x-movary-token': '{{apiKey}}'
});

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}}/users/:username/watchlist/movies',
  headers: {'x-movary-token': '{{apiKey}}'}
};

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

const url = '{{baseUrl}}/users/:username/watchlist/movies';
const options = {method: 'GET', headers: {'x-movary-token': '{{apiKey}}'}};

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

NSDictionary *headers = @{ @"x-movary-token": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/users/:username/watchlist/movies"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

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}}/users/:username/watchlist/movies" in
let headers = Header.add (Header.init ()) "x-movary-token" "{{apiKey}}" in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/users/:username/watchlist/movies",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-movary-token: {{apiKey}}"
  ],
]);

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/users/:username/watchlist/movies', [
  'headers' => [
    'x-movary-token' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/users/:username/watchlist/movies');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/users/:username/watchlist/movies');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-movary-token' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/users/:username/watchlist/movies' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-movary-token", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/users/:username/watchlist/movies' -Method GET -Headers $headers
import http.client

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

headers = { 'x-movary-token': "{{apiKey}}" }

conn.request("GET", "/baseUrl/users/:username/watchlist/movies", headers=headers)

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

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

url = "{{baseUrl}}/users/:username/watchlist/movies"

headers = {"x-movary-token": "{{apiKey}}"}

response = requests.get(url, headers=headers)

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

url <- "{{baseUrl}}/users/:username/watchlist/movies"

response <- VERB("GET", url, add_headers('x-movary-token' = '{{apiKey}}'), content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/users/:username/watchlist/movies")

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

request = Net::HTTP::Get.new(url)
request["x-movary-token"] = '{{apiKey}}'

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

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

response = conn.get('/baseUrl/users/:username/watchlist/movies') do |req|
  req.headers['x-movary-token'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

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

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-movary-token", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

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

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/users/:username/watchlist/movies \
  --header 'x-movary-token: {{apiKey}}'
http GET {{baseUrl}}/users/:username/watchlist/movies \
  x-movary-token:'{{apiKey}}'
wget --quiet \
  --method GET \
  --header 'x-movary-token: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/users/:username/watchlist/movies
import Foundation

let headers = ["x-movary-token": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/users/:username/watchlist/movies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

{
  "currentPage": 1,
  "maxPage": 10
}
POST Endpoint to scrobble your Emby watches to Movary.
{{baseUrl}}/webhook/emby/:uuid
QUERY PARAMS

UUID
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/emby/:uuid?UUID=");

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

(client/post "{{baseUrl}}/webhook/emby/:uuid" {:query-params {:UUID ""}})
require "http/client"

url = "{{baseUrl}}/webhook/emby/:uuid?UUID="

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

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

func main() {

	url := "{{baseUrl}}/webhook/emby/:uuid?UUID="

	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/webhook/emby/:uuid?UUID= HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/emby/:uuid?UUID=")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/emby/:uuid?UUID="))
    .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}}/webhook/emby/:uuid?UUID=")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/emby/:uuid?UUID=")
  .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}}/webhook/emby/:uuid?UUID=');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/emby/:uuid',
  params: {UUID: ''}
};

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

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

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/emby/:uuid?UUID=")
  .post(null)
  .build()

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

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/emby/:uuid?UUID=',
  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}}/webhook/emby/:uuid',
  qs: {UUID: ''}
};

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

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

const req = unirest('POST', '{{baseUrl}}/webhook/emby/:uuid');

req.query({
  UUID: ''
});

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}}/webhook/emby/:uuid',
  params: {UUID: ''}
};

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

const url = '{{baseUrl}}/webhook/emby/:uuid?UUID=';
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}}/webhook/emby/:uuid?UUID="]
                                                       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}}/webhook/emby/:uuid?UUID=" in

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

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

$request->setQueryData([
  'UUID' => ''
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/emby/:uuid');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
  'UUID' => ''
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/emby/:uuid?UUID=' -Method POST 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/emby/:uuid?UUID=' -Method POST 
import http.client

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

conn.request("POST", "/baseUrl/webhook/emby/:uuid?UUID=")

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

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

url = "{{baseUrl}}/webhook/emby/:uuid"

querystring = {"UUID":""}

response = requests.post(url, params=querystring)

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

url <- "{{baseUrl}}/webhook/emby/:uuid"

queryString <- list(UUID = "")

response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/webhook/emby/:uuid?UUID=")

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/webhook/emby/:uuid') do |req|
  req.params['UUID'] = ''
end

puts response.status
puts response.body
use reqwest;

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

    let querystring = [
        ("UUID", ""),
    ];

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .send()
        .await;

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

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/webhook/emby/:uuid?UUID='
http POST '{{baseUrl}}/webhook/emby/:uuid?UUID='
wget --quiet \
  --method POST \
  --output-document \
  - '{{baseUrl}}/webhook/emby/:uuid?UUID='
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/emby/:uuid?UUID=")! 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()
POST Endpoint to scrobble your Jellyfin watches to Movary.
{{baseUrl}}/webhook/jellyfin/:uuid
QUERY PARAMS

UUID
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/jellyfin/:uuid?UUID=");

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

(client/post "{{baseUrl}}/webhook/jellyfin/:uuid" {:query-params {:UUID ""}})
require "http/client"

url = "{{baseUrl}}/webhook/jellyfin/:uuid?UUID="

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

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

func main() {

	url := "{{baseUrl}}/webhook/jellyfin/:uuid?UUID="

	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/webhook/jellyfin/:uuid?UUID= HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/jellyfin/:uuid?UUID=")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/jellyfin/:uuid?UUID="))
    .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}}/webhook/jellyfin/:uuid?UUID=")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/jellyfin/:uuid?UUID=")
  .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}}/webhook/jellyfin/:uuid?UUID=');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/jellyfin/:uuid',
  params: {UUID: ''}
};

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

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

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/jellyfin/:uuid?UUID=")
  .post(null)
  .build()

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

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/jellyfin/:uuid?UUID=',
  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}}/webhook/jellyfin/:uuid',
  qs: {UUID: ''}
};

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

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

const req = unirest('POST', '{{baseUrl}}/webhook/jellyfin/:uuid');

req.query({
  UUID: ''
});

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}}/webhook/jellyfin/:uuid',
  params: {UUID: ''}
};

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

const url = '{{baseUrl}}/webhook/jellyfin/:uuid?UUID=';
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}}/webhook/jellyfin/:uuid?UUID="]
                                                       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}}/webhook/jellyfin/:uuid?UUID=" in

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

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

$request->setQueryData([
  'UUID' => ''
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/jellyfin/:uuid');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
  'UUID' => ''
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/jellyfin/:uuid?UUID=' -Method POST 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/jellyfin/:uuid?UUID=' -Method POST 
import http.client

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

conn.request("POST", "/baseUrl/webhook/jellyfin/:uuid?UUID=")

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

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

url = "{{baseUrl}}/webhook/jellyfin/:uuid"

querystring = {"UUID":""}

response = requests.post(url, params=querystring)

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

url <- "{{baseUrl}}/webhook/jellyfin/:uuid"

queryString <- list(UUID = "")

response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/webhook/jellyfin/:uuid?UUID=")

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/webhook/jellyfin/:uuid') do |req|
  req.params['UUID'] = ''
end

puts response.status
puts response.body
use reqwest;

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

    let querystring = [
        ("UUID", ""),
    ];

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .send()
        .await;

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

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/webhook/jellyfin/:uuid?UUID='
http POST '{{baseUrl}}/webhook/jellyfin/:uuid?UUID='
wget --quiet \
  --method POST \
  --output-document \
  - '{{baseUrl}}/webhook/jellyfin/:uuid?UUID='
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/jellyfin/:uuid?UUID=")! 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()
POST Endpoint to scrobble your Kodi watches to Movary.
{{baseUrl}}/webhook/kodi/:uuid
QUERY PARAMS

UUID
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/kodi/:uuid?UUID=");

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

(client/post "{{baseUrl}}/webhook/kodi/:uuid" {:query-params {:UUID ""}})
require "http/client"

url = "{{baseUrl}}/webhook/kodi/:uuid?UUID="

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

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

func main() {

	url := "{{baseUrl}}/webhook/kodi/:uuid?UUID="

	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/webhook/kodi/:uuid?UUID= HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/kodi/:uuid?UUID=")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/kodi/:uuid?UUID="))
    .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}}/webhook/kodi/:uuid?UUID=")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/kodi/:uuid?UUID=")
  .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}}/webhook/kodi/:uuid?UUID=');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/kodi/:uuid',
  params: {UUID: ''}
};

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

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

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/kodi/:uuid?UUID=")
  .post(null)
  .build()

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

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/kodi/:uuid?UUID=',
  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}}/webhook/kodi/:uuid',
  qs: {UUID: ''}
};

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

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

const req = unirest('POST', '{{baseUrl}}/webhook/kodi/:uuid');

req.query({
  UUID: ''
});

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}}/webhook/kodi/:uuid',
  params: {UUID: ''}
};

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

const url = '{{baseUrl}}/webhook/kodi/:uuid?UUID=';
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}}/webhook/kodi/:uuid?UUID="]
                                                       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}}/webhook/kodi/:uuid?UUID=" in

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

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

$request->setQueryData([
  'UUID' => ''
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/kodi/:uuid');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
  'UUID' => ''
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/kodi/:uuid?UUID=' -Method POST 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/kodi/:uuid?UUID=' -Method POST 
import http.client

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

conn.request("POST", "/baseUrl/webhook/kodi/:uuid?UUID=")

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

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

url = "{{baseUrl}}/webhook/kodi/:uuid"

querystring = {"UUID":""}

response = requests.post(url, params=querystring)

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

url <- "{{baseUrl}}/webhook/kodi/:uuid"

queryString <- list(UUID = "")

response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/webhook/kodi/:uuid?UUID=")

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/webhook/kodi/:uuid') do |req|
  req.params['UUID'] = ''
end

puts response.status
puts response.body
use reqwest;

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

    let querystring = [
        ("UUID", ""),
    ];

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .send()
        .await;

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

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/webhook/kodi/:uuid?UUID='
http POST '{{baseUrl}}/webhook/kodi/:uuid?UUID='
wget --quiet \
  --method POST \
  --output-document \
  - '{{baseUrl}}/webhook/kodi/:uuid?UUID='
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/kodi/:uuid?UUID=")! 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()
POST Endpoint to scrobble your Plex watches to Movary.
{{baseUrl}}/webhook/plex/:uuid
QUERY PARAMS

UUID
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/plex/:uuid?UUID=");

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

(client/post "{{baseUrl}}/webhook/plex/:uuid" {:query-params {:UUID ""}})
require "http/client"

url = "{{baseUrl}}/webhook/plex/:uuid?UUID="

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

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

func main() {

	url := "{{baseUrl}}/webhook/plex/:uuid?UUID="

	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/webhook/plex/:uuid?UUID= HTTP/1.1
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/plex/:uuid?UUID=")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/plex/:uuid?UUID="))
    .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}}/webhook/plex/:uuid?UUID=")
  .post(null)
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/plex/:uuid?UUID=")
  .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}}/webhook/plex/:uuid?UUID=');

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

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/plex/:uuid',
  params: {UUID: ''}
};

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

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

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/plex/:uuid?UUID=")
  .post(null)
  .build()

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

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/plex/:uuid?UUID=',
  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}}/webhook/plex/:uuid',
  qs: {UUID: ''}
};

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

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

const req = unirest('POST', '{{baseUrl}}/webhook/plex/:uuid');

req.query({
  UUID: ''
});

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}}/webhook/plex/:uuid',
  params: {UUID: ''}
};

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

const url = '{{baseUrl}}/webhook/plex/:uuid?UUID=';
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}}/webhook/plex/:uuid?UUID="]
                                                       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}}/webhook/plex/:uuid?UUID=" in

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

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

$request->setQueryData([
  'UUID' => ''
]);

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/plex/:uuid');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
  'UUID' => ''
]));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/plex/:uuid?UUID=' -Method POST 
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/plex/:uuid?UUID=' -Method POST 
import http.client

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

conn.request("POST", "/baseUrl/webhook/plex/:uuid?UUID=")

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

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

url = "{{baseUrl}}/webhook/plex/:uuid"

querystring = {"UUID":""}

response = requests.post(url, params=querystring)

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

url <- "{{baseUrl}}/webhook/plex/:uuid"

queryString <- list(UUID = "")

response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))

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

url = URI("{{baseUrl}}/webhook/plex/:uuid?UUID=")

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/webhook/plex/:uuid') do |req|
  req.params['UUID'] = ''
end

puts response.status
puts response.body
use reqwest;

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

    let querystring = [
        ("UUID", ""),
    ];

    let client = reqwest::Client::new();
    let response = client.post(url)
        .query(&querystring)
        .send()
        .await;

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

    dbg!(results);
}
curl --request POST \
  --url '{{baseUrl}}/webhook/plex/:uuid?UUID='
http POST '{{baseUrl}}/webhook/plex/:uuid?UUID='
wget --quiet \
  --method POST \
  --output-document \
  - '{{baseUrl}}/webhook/plex/:uuid?UUID='
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/plex/:uuid?UUID=")! 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()