コード例 #1
0
 public string Execute()
 {
     ClientRest client = null;
     string result = null;
     Uri uri = null;
     client = new ClientRest();
     client.Headers[HttpRequestHeader.ContentType] = "application/json";
     if (!client.IsBusy)
     {
         uri = new Uri(requestUrl, UriKind.Absolute);
         if (this.method.Equals("POST", StringComparison.CurrentCultureIgnoreCase))
         {
             result = client.UploadString(uri, method, paramStr);
         }
         else
         {
             result = client.DownloadString(uri);
         }
     }
     return result;
 }
コード例 #2
0
        public string Execute()
        {
            ClientRest client = null;
            string     result = null;
            Uri        uri    = null;

            client = new ClientRest();
            client.Headers[HttpRequestHeader.ContentType] = "application/json";
            if (!client.IsBusy)
            {
                uri = new Uri(requestUrl, UriKind.Absolute);
                if (this.method.Equals("POST", StringComparison.CurrentCultureIgnoreCase))
                {
                    result = client.UploadString(uri, method, paramStr);
                }
                else
                {
                    result = client.DownloadString(uri);
                }
            }
            return(result);
        }