From 0e58c68eca1e24296924a5b2600faa74e08f17b7 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 27 Dec 2022 05:10:52 -0500 Subject: [PATCH] Add the `_request_raw_response` function (#117) --- Project.toml | 2 +- src/requests.jl | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 940db90..0e3ae74 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FHIRClient" uuid = "b44d2ca2-8176-4fa9-8684-826e17b2a2da" authors = ["Dilum Aluthge", "Rhode Island Quality Institute", "contributors"] -version = "1.0.3" +version = "1.1.0" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/requests.jl b/src/requests.jl index a0c2f9e..c851d2f 100644 --- a/src/requests.jl +++ b/src/requests.jl @@ -94,6 +94,17 @@ end body::Union{AbstractString, Nothing} = nothing, headers::AbstractDict = Dict{String, String}(), query::Union{AbstractDict, Nothing} = nothing)::String + response = _request_raw_response(client, verb, path; body=body, headers=headers, query=query) + response_body_string::String = String(response.body)::String + return response_body_string +end + +@inline function _request_raw_response(client::Client, + verb::AbstractString, + path::AbstractString; + body::Union{AbstractString, Nothing} = nothing, + headers::AbstractDict = Dict{String, String}(), + query::Union{AbstractDict, Nothing} = nothing) full_url = _generate_full_url(client, path) _new_headers = Dict{String, String}() @@ -106,8 +117,7 @@ end query, body) empty!(_new_headers) - response_body_string::String = String(response.body)::String - return response_body_string + return response end @inline function _write_json_request_body(body::Nothing)::Nothing