curl --request POST \
  --url https://api.wassenger.com/v1/messages \
  --header 'token: <api key>' \
  --data '{"phone":"+1234567890","message":"Hello world! This is a test message"}'
echo '{"phone":"+1234567890","message":"Hello world! This is a test message"}' |  \
  http POST https://api.wassenger.com/v1/messages \
  token:'<api key>'
var unirest = require("unirest");

var req = unirest("POST", "https://api.wassenger.com/v1/messages");

req.headers({
  "token": "<api key>"
});

req.type("json");
req.send({
  "phone": "+1234567890",
  "message": "Hello world! This is a test message"
});

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

  console.log(res.body);
});
var request = require("request");

var options = {
  method: 'POST',
  url: 'https://api.wassenger.com/v1/messages',
  headers: {token: '<api key>'},
  body: {phone: '+1234567890', message: 'Hello world! This is a test message'},
  json: true
};

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

  console.log(body);
});
fetch("https://api.wassenger.com/v1/messages", {
  "method": "POST",
  "headers": {
    "token": "<api key>"
  },
  "body": {
    "phone": "+1234567890",
    "message": "Hello world! This is a test message"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.log(err);
});
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.wassenger.com/v1/messages",
  "method": "POST",
  "headers": {
    "token": "<api key>"
  },
  "processData": false,
  "data": "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
HttpResponse<String> response = Unirest.post("https://api.wassenger.com/v1/messages")
  .header("token", "<api key>")
  .body("{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}")
  .asString();
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}");
Request request = new Request.Builder()
  .url("https://api.wassenger.com/v1/messages")
  .post(body)
  .addHeader("token", "<api key>")
  .build();

Response response = client.newCall(request).execute();
import requests

url = "https://api.wassenger.com/v1/messages"

payload = "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}"
headers = {'token': '<api key>'}

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.wassenger.com/v1/messages",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}",
  CURLOPT_HTTPHEADER => array(
    "token: <api key>"
  ),
));

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"phone":"+1234567890","message":"Hello world! This is a test message"}');

$request->setRequestUrl('https://api.wassenger.com/v1/messages');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'token' => '<api key>'
));

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

echo $response->getBody();
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.wassenger.com/v1/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["token"] = '<api key>'
request.body = "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}"

response = http.request(request)
puts response.read_body
package main

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

func main() {

	url := "https://api.wassenger.com/v1/messages"

	payload := strings.NewReader("{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}")

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

	req.Header.Add("token", "<api key>")

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

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

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

}
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("token", "<api key>");
request.AddParameter("undefined", "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation

let headers = ["token": "<api key>"]
let parameters = [
  "phone": "+1234567890",
  "message": "Hello world! This is a test message"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.wassenger.com/v1/messages")! 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)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.wassenger.com/v1/messages");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "token: <api key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}");

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

(client/post "https://api.wassenger.com/v1/messages" {:headers {:token "<api key>"}
                                                      :content-type :json
                                                      :form-params {:phone "+1234567890"
                                                                    :message "Hello world! This is a test message"}})
$headers=@{}
$headers.Add("token", "<api key>")
$response = Invoke-RestMethod -Uri 'https://api.wassenger.com/v1/messages' -Method POST -Headers $headers -ContentType 'undefined' -Body '{"phone":"+1234567890","message":"Hello world! This is a test message"}'
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "https://api.wassenger.com/v1/messages" in
let headers = Header.add (Header.init ()) "token" "<api key>" in
let body = Cohttp_lwt_body.of_string "{\"phone\":\"+1234567890\",\"message\":\"Hello world! This is a test message\"}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)