c# - Using RESTapi to connect to TFS online from code -


I'm trying to get access to your C # code to your projects in TFS line to build all data About, work with restapi, projects etc. I follow the online documentation available to it (though), I would like to get Jason response URL, I always get: http code 203: non-official information, and so I get Jesnsn data I'm not able. If I try to get feedback using POSTMAN (Chrome extension) so I get a HTTP code 200 and I need that data.

This is my code:

  public static void async GetBuilds () {try {var username = "userTest"; Var Password = "Passast"; (HTTP Client client = new HTTP client ()) (client.DefaultRequestHeaders.Accept.Add (New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue ( "application / JSON")); Client.DefaultRequestHeaders.Authorization = new authentication header value ( "Basic" convert. ToBase64String (System.Text.ASCIIEncoding.ASCII.GetBytes (string.Format ( "{0}: {1}", username, password)))); (HttpResponseMessage response = client.GetAsync ( " Using https://myproject.visualstudio.com/DefaultCollection/_apis/build/builds?api-version=1.0-preview.1").Result) {response.EnsureSuccessStatusCode (); String feedbackBody = response is awaiting. The content ReedstressingSync (); Console.WriteLine (responseBody);}}} Hold (Exception Pre) {Console.WriteLine (ex.ToString ());}}  

I always have a high Amount in quantity, but nothing about what I need, what am I doing?

Thank you in advance for your time.

Your code seems right to me Have you enabled optional credentials for your VSO account? It will not work without it Here's how to do it.

You can also view your project on CodePlex: It shows how to use some VSO Rest API using C #


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -