I’m trying to build a custom registration page that makes a call to my .NET API.
function Test_WBG_Conntection()
{
//WBG Object
$OAuth = new OAuth;
$OAuth->Administrator = 'username';
$OAuth->Password = 'password';
//API URL "http://www.whiteboxgaming.xyz:34188/";
$url = $endpoint.'api/WhiteBoXGaming/Post_TestAPI';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($OAuth));
$response = curl_exec($ch);
if($response === FALSE)
{
echo "cURL Error" . curl_error($ch);
}
curl_close($ch);
return $response;
}
Error: cURL ErrorFailed to connect to www.whiteboxgaming.xyz port 34188: Connection refused
Here is my object:
PHP:
<?php
class OAuth
{
var $Administrator;
var $Password;
}
?>
.Net
public class OAuth
{
public string Administrator { get; set; }
public string Password { get; set; }
}
Not sure why its giving an error.This is a working API and I’ve used several different apps with it.