コード例 #1
0
ファイル: TestRunBook.cs プロジェクト: smuki/RESTA
 private void executeRestGet(string id, XElement xtest)
 {
     Console.WriteLine("Running test " + id);
     try
     {
         var input = new RestRequest();
         input.Url    = XTools.Attr(xtest, "url");
         input.Url    = Render.StringToString(input.Url, envariables);
         input.header = headers;
         var client   = new RestClient();
         var response = client.get("GET", input);
         Console.WriteLine("  url:          {0}", input.Url);
         Console.WriteLine("  code:         {0}", response.HttpCode);
         Console.WriteLine("  content type: {0}", response.ContentType);
         Console.WriteLine("  Message:      {0}", response.Message);
         Console.WriteLine(response.RawData);
     }
     catch (Exception ex)
     {
         Terminal.WriteError(ex);
     }
 }