internal protected virtual object Api(string path, IDictionary <string, object> parameters, HttpMethod httpMethod, Type resultType)
{
var mergedParameters = FacebookUtils.Merge(null, parameters);
if (!mergedParameters.ContainsKey("access_token") && !string.IsNullOrEmpty(AccessToken))
{
mergedParameters["access_token"] = AccessToken;
}
Uri requestUrl;
string contentType;
byte[] postData = BuildRequestData(path, mergedParameters, httpMethod, out requestUrl, out contentType);
var jsonString = MakeRequest(httpMethod, requestUrl, postData, contentType);
var json = JsonSerializer.Current.DeserializeObject(jsonString);
FacebookApiException facebookApiException =
ExceptionFactory.GetGraphException(json) ??
ExceptionFactory.CheckForRestException(DomainMaps, requestUrl, json);
if (facebookApiException != null)
{
throw facebookApiException;
}
return(resultType == null ? json : JsonSerializer.Current.DeserializeObject(jsonString, resultType));
}