Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/480 FhirClient implementation with HttpClient #507

Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4e8b755
Initial work on converting from WebRequest to HttpClient.
Nov 20, 2017
b525bbc
Body now getting written to request.
Nov 20, 2017
4e04239
Fixed tests to use new .NET types and fixed some parsing issues.
Nov 20, 2017
1e2e0f3
Changed types for rebase onto develop-dstu3.
Nov 21, 2017
2be2b92
Fixed missing search parameter argument from rebase and fixed tests u…
Nov 21, 2017
3cc2a79
Ensured that we don't try to convert an empty body to a response bundle.
Nov 21, 2017
90eb380
Fixed some comments referencing HttpWeb[Request/Response] and fixed a…
Nov 22, 2017
c24f532
Added comments and removed dead code.
Nov 22, 2017
2ae3d35
Fixed formatting.
Nov 22, 2017
6d88720
All classes wrapping HttpClient are now IDisposables
Nov 27, 2017
bf59ad4
Removed generated docstrings.
Nov 27, 2017
d7ef495
Moved setting of user agent to default request headers.
Nov 27, 2017
8bf076e
Dispose of fhir clients during tests.
Nov 27, 2017
65fd4eb
Finished adding using statements to REST tests.
Nov 27, 2017
f09becc
Added using statements for Requesters HttpResponseMessage and HttpReq…
Nov 28, 2017
e244e7c
Merge branch 'develop-stu3' into feature/httpclient
Dec 4, 2017
0b9104d
Moved common code to IFhirCompatibleClient
Dec 4, 2017
3de9632
Added stub for new fhir client.
Dec 4, 2017
31d4b96
Added stub for httpclient specific requester
Dec 4, 2017
ed73dd9
Moved new implementations to new namespace, restored old implementati…
Dec 4, 2017
349bb4a
Refactored common code to base class for FhirClient and Requester.
Dec 4, 2017
4ff7dab
Copied modified tests to Http specific test directory.
Dec 4, 2017
78dfba5
Changed Http/ to actually be changed tests.
Dec 4, 2017
674f169
Fixed constructor not having optional parameter.
Dec 4, 2017
9b6cfa0
Deleted extra test files and resolved to place new tests alongside ol…
Dec 4, 2017
14836e8
Added mock message handler and started adding HttpClient tests.
Dec 5, 2017
49c1030
Modified client operations to work on fhir client base class.
Dec 5, 2017
cb751a5
Modified more tests for HttpClient addition
Dec 5, 2017
8836481
Merge branch 'develop-stu3' into feature/httpclient
Dec 5, 2017
4f5e304
Fixed some using statements in client tests.
Dec 5, 2017
5d0326f
Removed unused delegates.
Dec 5, 2017
ef39dbb
Obsolete properties now included in common interface, will throw NotI…
Dec 5, 2017
d1b8f76
Added operations tests for new client.
Dec 5, 2017
1da3f4b
Added async read tests for new client.
Dec 5, 2017
aaa0688
Added async search tests for new client.
Dec 5, 2017
4439d99
Added update/refresh/delete tests for new client.
Dec 5, 2017
e98ad76
Fixed faulty tests, bad logic in MockHandler, refactored exception lo…
Dec 5, 2017
b0fd949
Added new client tests for TerminologyTests.
Dec 5, 2017
43bb2a4
Reverted System.Net.Http version dependency
Dec 6, 2017
92e7602
Made changes per first set of review comments on base fhir-net-api repo.
Dec 12, 2017
79ae559
Removed unnecessary include.
Dec 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed some comments referencing HttpWeb[Request/Response] and fixed a…
… test that was adding headers twice.
Henley_Contractor, Devereux authored and Henley_Contractor, Devereux committed Nov 22, 2017
commit 90eb3800ccb0410f2447f989fc3751739e59c610
5 changes: 0 additions & 5 deletions src/Hl7.Fhir.Core.Tests/Rest/FhirClientTests.cs
Original file line number Diff line number Diff line change
@@ -850,25 +850,20 @@ public void TestBinaryDetection()
public void RequestFullResource()
{
var client = new FhirClient(testEndpoint);
var minimal = false;
client.OnBeforeRequest += (object s, BeforeRequestEventArgs e) => e.RawRequest.Headers.TryAddWithoutValidation("Prefer", minimal ? "return=minimal" : "return=representation");

var result = client.Read<Patient>("Patient/glossy");
Assert.IsNotNull(result);
result.Id = null;
result.Meta = null;

client.PreferredReturn = Prefer.ReturnRepresentation;
minimal = false;
var posted = client.Create(result);
Assert.IsNotNull(posted, "Patient example not found");

minimal = true; // simulate a server that does not return a body, even if ReturnFullResource = true
posted = client.Create(result);
Assert.IsNotNull(posted, "Did not return a resource, even when ReturnFullResource=true");

client.PreferredReturn = Prefer.ReturnMinimal;
minimal = true;
posted = client.Create(result);
Assert.IsNull(posted);
}
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Core/Rest/FhirClient.cs
Original file line number Diff line number Diff line change
@@ -1025,7 +1025,7 @@ private void setResourceBase(Resource resource, string baseUri)
public event EventHandler<AfterResponseEventArgs> OnAfterResponse;

/// <summary>
/// Inspect or modify the HttpWebRequest just before the FhirClient issues a call to the server
/// Inspect or modify the <see cref="HttpRequestMessage"/> just before the FhirClient issues a call to the server
/// </summary>
/// <param name="rawRequest">The request as it is about to be sent to the server</param>
/// <param name="body">The data in the body of the request as it is about to be sent to the server</param>
@@ -1036,9 +1036,9 @@ protected virtual void BeforeRequest(HttpRequestMessage rawRequest, byte[] body)
}

/// <summary>
/// Inspect the HttpWebResponse as it came back from the server
/// Inspect the <see cref="HttpResponseMessage"/> as it came back from the server
/// </summary>
/// <remarks>You cannot read the body from the HttpWebResponse, since it has
/// <remarks>You cannot read the body from the HttpResponseMessage, since it has
/// already been read by the framework. Use the body parameter instead.</remarks>
protected virtual void AfterResponse(HttpResponseMessage webResponse, byte[] body)
{