Skip to content

Commit 2c14d43

Browse files
committed
add constructors: Response(s::Int, body::AbstractString) and Response(s::Int, body::AbstractVector{UInt8}) per JuliaWeb/GitHub.jl#102
1 parent 38310b5 commit 2c14d43

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Messages.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ mutable struct Response <: Message
121121
end
122122
end
123123

124+
Response(s::Int, body::AbstractVector{UInt8}) = Response(s; body=body)
125+
Response(s::Int, body::AbstractString) = Response(s, Vector{UInt8}(body))
126+
124127
Response(bytes) = parse(Response, bytes)
125128

126129
function reset!(r::Response)

0 commit comments

Comments
 (0)