Skip to content

Commit

Permalink
Merge pull request #5 from sendgrid/async-fix
Browse files Browse the repository at this point in the history
Async fix
  • Loading branch information
thinkingserious authored Jun 16, 2016
2 parents b435c4c + 34ecf4a commit 150b93f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ CSharpHTTPClient/*/obj/
CSharpHTTPClient/CSharpHTTPClient.userprefs
CSharpHTTPClient/packages/
CSharpHTTPClient/CSharpHTTPClient.sln.VisualState.xml
*.pfx
*.PublicKey
*.PublicKey
*.pfx
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## [2.0.2] - 2016-06-16
### Added
- Fix async, per https://github.com/sendgrid/sendgrid-csharp/issues/235

## [2.0.1] - 2016-06-03
### Added
- Sign assembly with a strong name
Expand Down
6 changes: 3 additions & 3 deletions CSharpHTTPClient/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private Client BuildClient(string name = null)
/// <summary>
/// Add the authorization header, override to customize
/// </summary>
/// <param name="header">Authoriztion header</param>
/// <param name="header">Authorization header</param>
/// <returns>Authorization value to add to the header</returns>
public virtual AuthenticationHeaderValue AddAuthorization(KeyValuePair<string, string> header)
{
Expand Down Expand Up @@ -261,7 +261,7 @@ public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, o
/// <returns>Response object</returns>
public async virtual Task<Response> MakeRequest(HttpClient client, HttpRequestMessage request)
{
HttpResponseMessage response = await client.SendAsync(request);
HttpResponseMessage response = await client.SendAsync(request).ConfigureAwait(false);
return new Response(response.StatusCode, response.Content, response.Headers);
}

Expand Down Expand Up @@ -318,7 +318,7 @@ private async Task<Response> RequestAsync(string method, String requestBody = nu
RequestUri = new Uri(endpoint),
Content = content
};
return await MakeRequest(client, request);
return await MakeRequest(client, request).ConfigureAwait(false);

}
catch (Exception ex)
Expand Down
4 changes: 2 additions & 2 deletions CSharpHTTPClient/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1")]
[assembly: AssemblyFileVersion("2.0.1")]
[assembly: AssemblyVersion("2.0.2")]
[assembly: AssemblyFileVersion("2.0.2")]
2 changes: 1 addition & 1 deletion Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void Main(string[] args)
}";
Dictionary<String, String> requestHeaders = new Dictionary<String, String>();
requestHeaders.Add("X-Test", "test");
dynamic response = client.version("v3").api_keys.get(queryParams: queryParams, requestHeaders: requestHeaders);
dynamic response = client.api_keys.get(queryParams: queryParams, requestHeaders: requestHeaders);
// Console.WriteLine(response.StatusCode);
// Console.WriteLine(response.Body.ReadAsStringAsync().Result);
// Console.WriteLine(response.Headers.ToString());
Expand Down
4 changes: 2 additions & 2 deletions Example/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: AssemblyVersion("2.0.2")]
[assembly: AssemblyFileVersion("2.0.2")]
4 changes: 2 additions & 2 deletions UnitTest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: AssemblyVersion("2.0.2")]
[assembly: AssemblyFileVersion("2.0.2")]

0 comments on commit 150b93f

Please sign in to comment.