@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
// <copyright file="RestApi .cs" company="BTU/IIT">
// <copyright file="HttpRequest .cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
@@ -13,9 +13,9 @@ namespace CampusAppWP8.Utility
using CampusAppWP8.Model.Utility ;
/// <summary>
/// Class realize the access of restful RestAPI
/// Class realize the access of restful HttpRequest
/// </summary>
public abstract class RestApi
public abstract class HttpRequest
{
#region Members
@@ -29,18 +29,18 @@ namespace CampusAppWP8.Utility
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="RestApi " /> class.
/// Initializes a new instance of the <see cref="HttpRequest " /> class.
/// </summary>
public RestApi ( )
public HttpRequest ( )
{
this . client = new WebClient ( ) ;
}
/// <summary>
/// Initializes a new instance of the <see cref="RestApi " /> class.
/// Initializes a new instance of the <see cref="HttpRequest " /> class.
/// </summary>
/// <param name="apiBaseAddress">the url of the RestAPI base address</param>
public RestApi ( Uri apiBaseAddress )
/// <param name="apiBaseAddress">the url of the HttpRequest base address</param>
public HttpRequest ( Uri apiBaseAddress )
{
this . client = new WebClient ( ) ;
this . client . BaseAddress = apiBaseAddress . AbsoluteUri ;
@@ -149,7 +149,7 @@ namespace CampusAppWP8.Utility
/// </summary>
/// <param name="url">Url of the resource</param>
/// <param name="action">callback method</param>
/// <param name="postData">Data which are sending via post to the RestAPI </param>
/// <param name="postData">Data which are sending via post to the HttpRequest </param>
public void HttpPost ( Uri url , Action < object , UploadStringCompletedEventArgs > action , string postData )
{
this . UploadData ( url , action , "POST" , postData ) ;
@@ -160,7 +160,7 @@ namespace CampusAppWP8.Utility
/// </summary>
/// <param name="url">Url of the resource</param>
/// <param name="action">callback method</param>
/// <param name="putData">Data which are sending via put to the RestAPI </param>
/// <param name="putData">Data which are sending via put to the HttpRequest </param>
public void HttpPut ( Uri url , Action < object , UploadStringCompletedEventArgs > action , string putData )
{
this . UploadData ( url , action , "PUT" , putData ) ;
@@ -171,7 +171,7 @@ namespace CampusAppWP8.Utility
/// </summary>
/// <param name="url">Url of the resource</param>
/// <param name="action">callback method</param>
/// <param name="patchData">Data which are sending via patch to the RestAPI </param>
/// <param name="patchData">Data which are sending via patch to the HttpRequest </param>
public void HttpPatch ( Uri url , Action < object , UploadStringCompletedEventArgs > action , string patchData )
{
this . UploadData ( url , action , "PATCH" , patchData ) ;
@@ -182,12 +182,12 @@ namespace CampusAppWP8.Utility
#region private
/// <summary>
/// Method uploaded Data to the RestAPI
/// Method uploaded Data to the HttpRequest
/// </summary>
/// <param name="url">Url of the resource</param>
/// <param name="action">callback method</param>
/// <param name="method">name of APIMethod, how the data will be uploaded</param>
/// <param name="data">Data which are sending to the RestAPI </param>
/// <param name="data">Data which are sending to the HttpRequest </param>
private void UploadData ( Uri url , Action < object , UploadStringCompletedEventArgs > action , string method , string data )
{
this . client . UploadStringCompleted + = new UploadStringCompletedEventHandler ( action ) ;