hi every one check the below code its give me 403 error.
i m trying to call php website through API
when i am trying to debug the code and the controll come on Byte[] array its throw an error.. and when i try to copy and past ur http://IP/clients/includes/api.php[^]
please help thanks in adavace its throw error authentication failed
public static string GetWHMCSAPIResults(string anaction)
{
// Instantiate the WebClient object
WebClient WHMCSclient = new WebClient();
string username = "DWCAPI";
string password = EncodeToMD5("123");
// Prepare a Name/Value collection to hold the post values
NameValueCollection form = new NameValueCollection();
form.Add("username", username);
form.Add("password", password); // the password will s ill need encoding is MD5 is a requirement
form.Add("action", anaction); // action performed by the API:Functions
form.Add("responsetype", "xml");
// Post the data and read the response
Byte[] responseData = WHMCSclient.UploadValues("http://IP/clients/includes/api.php", form);
// Decode and display the response.
//nsole.WriteLine("\nResponse received was \n{0}",
string result = System.Text.Encoding.ASCII.GetString(responseData);
if (result.Contains("result=error"))
{
result = null;
}
return result;
}