PivotalTrackerAPI/Domain/Services/PivotalService.cs
/// <summary>
/// Generic method for getting data from the Pivotal API and returning the response but uses Basic Auth
/// </summary>
/// <param name="url">The url to submit to</param>
/// <param name="login">The user's login</param>
/// <param name="password">The user's password</param>
/// <returns>The response from Pivotal</returns>
Generic method for getting data from the Pivotal API and returning the response but uses Basic Auth
Generic method for getting data from the Pivotal API and returning the response but uses Basic Auth
public static XmlDocument GetDataWithCredentials(string url, string login, string password)
    {
      var uri = new Uri(url);
      HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
      request.Credentials = new NetworkCredential(login, password);
      Stream objStream;
      objStream = request.GetResponse().GetResponseStream();
      StreamReader objReader = new StreamReader(objStream);
      XmlDocument xmlDoc = new XmlDocument();
      xmlDoc.Load(objReader);
      return xmlDoc;
    }
public static XmlDocument GetDataWithCredentials ( string url , string login , string password ) { var uri = new Uri ( url ) ; HttpWebRequest request = ( HttpWebRequest ) WebRequest . Create ( uri ) ; request . Credentials = new NetworkCredential ( login , password ) ; Stream objStream ; objStream = request . GetResponse ( ) . GetResponseStream ( ) ; StreamReader objReader = new StreamReader ( objStream ) ; XmlDocument xmlDoc = new XmlDocument ( ) ; xmlDoc . Load ( objReader ) ; return xmlDoc ; }
Generic method for getting data from the Pivotal API and returning the response but uses Basic Auth
Generic method for getting data from the Pivotal API and returning the response but uses Basic Auth
The response from Pivotal
The response from Pivotal
url
string
The url to submit to
The url to submit to
login
string
The user's login
The user ' s login
password
string
The user's password
The user ' s password