Skip to content

Commit 150b93f

Browse files
Merge pull request #5 from sendgrid/async-fix
Async fix
2 parents b435c4c + 34ecf4a commit 150b93f

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ CSharpHTTPClient/*/obj/
1212
CSharpHTTPClient/CSharpHTTPClient.userprefs
1313
CSharpHTTPClient/packages/
1414
CSharpHTTPClient/CSharpHTTPClient.sln.VisualState.xml
15-
*.pfx
16-
*.PublicKey
15+
*.PublicKey
16+
*.pfx

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

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

6+
## [2.0.2] - 2016-06-16
7+
### Added
8+
- Fix async, per https://github.com/sendgrid/sendgrid-csharp/issues/235
9+
610
## [2.0.1] - 2016-06-03
711
### Added
812
- Sign assembly with a strong name

CSharpHTTPClient/Client.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private Client BuildClient(string name = null)
162162
/// <summary>
163163
/// Add the authorization header, override to customize
164164
/// </summary>
165-
/// <param name="header">Authoriztion header</param>
165+
/// <param name="header">Authorization header</param>
166166
/// <returns>Authorization value to add to the header</returns>
167167
public virtual AuthenticationHeaderValue AddAuthorization(KeyValuePair<string, string> header)
168168
{
@@ -261,7 +261,7 @@ public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, o
261261
/// <returns>Response object</returns>
262262
public async virtual Task<Response> MakeRequest(HttpClient client, HttpRequestMessage request)
263263
{
264-
HttpResponseMessage response = await client.SendAsync(request);
264+
HttpResponseMessage response = await client.SendAsync(request).ConfigureAwait(false);
265265
return new Response(response.StatusCode, response.Content, response.Headers);
266266
}
267267

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

323323
}
324324
catch (Exception ex)

CSharpHTTPClient/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("2.0.1")]
35-
[assembly: AssemblyFileVersion("2.0.1")]
34+
[assembly: AssemblyVersion("2.0.2")]
35+
[assembly: AssemblyFileVersion("2.0.2")]

Example/Example.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static void Main(string[] args)
2727
}";
2828
Dictionary<String, String> requestHeaders = new Dictionary<String, String>();
2929
requestHeaders.Add("X-Test", "test");
30-
dynamic response = client.version("v3").api_keys.get(queryParams: queryParams, requestHeaders: requestHeaders);
30+
dynamic response = client.api_keys.get(queryParams: queryParams, requestHeaders: requestHeaders);
3131
// Console.WriteLine(response.StatusCode);
3232
// Console.WriteLine(response.Body.ReadAsStringAsync().Result);
3333
// Console.WriteLine(response.Headers.ToString());

Example/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.0.1.0")]
36-
[assembly: AssemblyFileVersion("2.0.1.0")]
35+
[assembly: AssemblyVersion("2.0.2")]
36+
[assembly: AssemblyFileVersion("2.0.2")]

UnitTest/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.0.1.0")]
36-
[assembly: AssemblyFileVersion("2.0.1.0")]
35+
[assembly: AssemblyVersion("2.0.2")]
36+
[assembly: AssemblyFileVersion("2.0.2")]

0 commit comments

Comments
 (0)