Exemple #1
0
        public override Object makeRequest()
        {
            string protocol = portalConn.alwaysUseSSL ? "https://" : "http://";
            Uri url = new Uri(String.Format("{0}{1}/sharing/rest/content/features/analyze?token={2}", protocol, portalConn.portalDomainName, portalConn.token));
            HttpPostRequest request = new HttpPostRequest(url);
            request.AddFields(this.request.getParameters());
            HttpWebResponse response = request.PostData();
            string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();

            this.response = JsonConvert.DeserializeObject<Response>(responseString);
            if (this.response == null)
            {
                // TODO: Error Handling
            }
            return this.response;
        }
Exemple #2
0
        public override Object makeRequest()
        {
            //TODO: config URL parts (http)
            Uri url = new Uri("http://" + portalConn.portalDomainName + "/sharing/rest/content/users/" + portalConn.username + "/createFolder?f=json&token=" + portalConn.token);
            HttpPostRequest request = new HttpPostRequest(url);
            request.AddFields(this.request.getParameters());
            HttpWebResponse response = request.PostData();
            string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();

            this.response = JsonConvert.DeserializeObject<Response>(responseString);
            if (!this.response.success)
            {
                // TODO: Error Handling
            }
            return this.response;
        }
        public override Object makeRequest()
        {
            this.request.password = portalConn.password;
            this.request.username = portalConn.username;
            this.request.referer = portalConn.clientReferer;
            // TODO: Don't hardcode this value
            this.request.expiration = "60";
            Uri url = new Uri("https://" + portalConn.portalDomainName + "/sharing/generateToken?f=json");
            HttpPostRequest request = new HttpPostRequest(url);
            request.AddFields(this.request.getParameters());

            HttpWebResponse response = request.PostData();
            string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
            Response r = JsonConvert.DeserializeObject<Response>(responseString);
            this.response = r;
            return r;
        }