Ejemplo n.º 1
0
        public static JToken PostProxy(HttpRequestMessage aInRequest, string aInBackendUrl)
        {
            if (aInRequest.Content == null)
            {
                return(null);
            }

            JToken lObj      = null;
            string jsonInput = string.Empty;

            jsonInput = aInRequest.Content.ReadAsStringAsync().Result;
            if (!string.IsNullOrEmpty(jsonInput))
            {
                lObj      = JRaw.Parse(jsonInput);
                jsonInput = lObj.ToString(Newtonsoft.Json.Formatting.None);
            }

            string lResult = ProxyUtils.PostData(aInRequest, aInBackendUrl, jsonInput);

            if (!string.IsNullOrEmpty(lResult))
            {
                lObj = JRaw.Parse(lResult);
                return(lObj);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public JToken GetProxy(string subscriptionId, string api)
        {
            Log.Logger.Writeline("Get API called {0}", this.Request.RequestUri);

            string lBackendUrl = GetBackendUrl();

            return(ProxyUtils.GetProxy(lBackendUrl));
        }
Ejemplo n.º 3
0
        public JToken PostProxy(string subscriptionId, string api)
        {
            HttpRequestMessage lRequest = this.Request;

            Log.Logger.Writeline("POST API called {0} ", lRequest.RequestUri);

            string lBackendUrl = GetBackendUrl();

            return(ProxyUtils.PostProxy(lRequest, lBackendUrl));
        }