Skip to content

Commit

Permalink
Update ServiceClient.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhivijay96 committed May 18, 2016
1 parent 4630b69 commit 4624e6f
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ protected void InitializeHttpClient(HttpClientHandler httpClientHandler, params
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(type.FullName,
GetClientVersion()));
}

//A mehtod to set user agent
/// <summary>
///A mehtod to set user agent
/// </summary>
public bool SetUserAgent(string productName)
{
if(!_disposed && HttpClient != null)
Expand All @@ -224,12 +225,14 @@ public bool SetUserAgent(string productName)
// returns true if the userAgent was added
return true;
}
// returns false if the httpclient was disposed before invoking the method
/// <summary>
///returns false if the httpclient was disposed before invoking the method
/// </summary>
return false;
}

//Another method to setuseragent and it's version

/// <summary>
///Another method to setuseragent and its version
/// </summary>
public bool SetUserAgent(string productName,string version)
{
if(!_disposed && HttpClient != null)
Expand All @@ -239,10 +242,14 @@ public bool SetUserAgent(string productName,string version)
/// </summary>
HttpClient.DefaultRequestHeaders.UserAgent.Clear();
HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName,version));
// returns true if the userAgent was added
/// <summary>
// returns true if the userAgent was added
/// </summary>
return true;
}
// returns false if the httpclient was disposed before invoking the method
/// <summary>
/// returns false if the httpclient was disposed before invoking the method
/// </summary>
return false;
}
/// <summary>
Expand Down

0 comments on commit 4624e6f

Please sign in to comment.