FHIRBaseRequestHandler
open class FHIRBaseRequestHandler: FHIRRequestHandler
Base implementation of FHIRRequestHandler
.
-
The HTTP method of the request.
Declaration
Swift
open let method: FHIRRequestMethod
-
Headers to be used on the request.
Declaration
Swift
open var headers = FHIRRequestHeaders()
-
Request parameters to pass along.
Declaration
Swift
open var parameters = FHIRRequestParameters()
-
Which options to apply.
Declaration
Swift
open var options: FHIRRequestOption
-
The data to be used in the request body.
Declaration
Swift
open var data: Data?
-
The receiver may hold on to a resource that supplies the request’s body data.
Declaration
Swift
open var resource: Resource?
-
Designated initializer.
Declaration
Swift
public required init(_ method: FHIRRequestMethod, resource: Resource? = nil)
-
Add the given headers to the request, overwriting existing headers.
Declaration
Swift
open func add(headers inHeaders: FHIRRequestHeaders)
Parameters
headers
The headers to add to the receiver
-
Prepare body data for the request.
Declaration
Swift
open func prepareData() throws
-
Give the request type a chance to prepare/alter the URL request.
Typically the FHIRRequestMethod instance sets the correct HTTPMethod as well as correct FHIR headers. It will also inspect the
options
property and add appropriate query params.Declaration
Swift
open func prepare(request: inout URLRequest) throws
-
Instantiate a FHIRServerResponse based on the response and data that we get.
Declaration
Swift
open func response(response: URLResponse?, data inData: Data? = nil, error: Error? = nil) -> FHIRServerResponse
-
Convenience method to indicate a request that has not actually been sent.
Declaration
Swift
open func notSent(_ reason: String) -> FHIRServerResponse