Connecting with .NET

Requesting a Token Sample:
var client = new RestClient("https://epsserviceapi.azurewebsites.net/Token");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddParameter("application/x-www-form-urlencoded", "userName={username}&Password={password}&grant_type=password", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

Connecting with PHP

Requesting a Token Sample (PHP HTTP HttpRequest):
setUrl('https://epsserviceapi.azurewebsites.net/Token');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
  'content-type' => 'application/x-www-form-urlencoded',
  'cache-control' => 'no-cache'
));
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
  'userName' => '{Username}',
  'Password' => '{Password}',
  'grant_type' => 'password'
));
try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
Requesting a Token Sample (PHP pecl_http):
append(new http\QueryString(array(
  'userName' => '{Username}',
  'Password' => '{Password}',
  'grant_type' => 'password'
)));
$request->setRequestUrl('https://epsserviceapi.azurewebsites.net/Token');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders(array(
  'content-type' => 'application/x-www-form-urlencoded',
  'cache-control' => 'no-cache'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
Requesting a Token Sample (PHP cURL):
 "https://epsserviceapi.azurewebsites.net/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 => "userName={Username}&Password={Password}&grant_type=password",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Connecting with HTTP

Requesting a Token Sample:
POST /Token HTTP/1.1
Host: epsserviceapi.azurewebsites.net
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
userName={Username}&Password={Password}&grant_type=password