Пример #1
0
 /// <summary>
 /// Initiates a request to the specified request URL and returns the response.
 /// </summary>
 /// <param name="requestUrl">Target endpoint of request.</param>
 /// <param name="postData">Post data to send with request.</param>
 /// <param name="mediaType">Media type of post data.</param>
 /// <returns></returns>
 public HttpResponseMessage ForwardRequest(string requestUrl, string postData, string mediaType)
 {
     if (!string.IsNullOrEmpty(requestUrl))
     {
         var dispatcher = new ServiceDispatcher();
         var data = dispatcher.ForwardRequest(requestUrl, postData, mediaType);
         return data;
     }
     else
         return null;
 }
Пример #2
0
 /// <summary>
 /// Retrieves the public data (JSON) for the specified module instance.
 /// </summary>
 /// <param name="instanceId">Module instance ID.</param>
 /// <param name="postData">Post data to send with request.</param>
 /// <returns></returns>
 public string GetModuleInstanceData(string instanceId, string postData)
 {
     if (!string.IsNullOrEmpty(instanceId))
     {
         var dispatcher = new ServiceDispatcher();
         var data = dispatcher.PostModuleInstancePublicData(instanceId, postData);
         return data;
     }
     else
         return null;
 }
Пример #3
0
        /// <summary>
        /// Retrieves the public HTML markup for the specified module instances.
        /// </summary>
        /// <param name="instanceIds">Collection of module instance IDs.</param>
        /// <param name="headers">Custom headers to send with request.</param>
        /// <returns></returns>
        public string[] GetModuleInstanceMarkupBulk(string[] instanceIds, Dictionary<string, string> headers = null)
        {
            if (instanceIds.Length > 0)
            {
                var dispatcher = new ServiceDispatcher();
                var markup = dispatcher.GetModuleInstancePublicMarkup(instanceIds, headers);

                return markup.Split(new string[] { _moduleMarkupDelimiter }, StringSplitOptions.RemoveEmptyEntries);
            }
            else
                return null;
        }