public async Task <string> SendRequest(MPEDHttpMethodType httpMethod, string controller, string action, object body, Dictionary <string, string> urlParams) { if (!string.IsNullOrEmpty(_token)) { AddAuthorizationHeader(_token); } string url = CreateFullUrl(controller, action, urlParams); switch (httpMethod) { case MPEDHttpMethodType.Get: return(await Get(url)); case MPEDHttpMethodType.Post: return(await Post(body, url)); case MPEDHttpMethodType.Put: return(await Put(body, url)); case MPEDHttpMethodType.Delete: return(await Delete(url)); default: return(await Get(url)); } }
public async Task <string> SendRequest(MPEDHttpMethodType httpMethod, string controller, string action, Dictionary <string, string> urlParams) { return(await SendRequest(httpMethod, controller, action, null, urlParams)); }