Skip to content

Commit

Permalink
add constructors: Response(s::Int, body::AbstractString) and Response…
Browse files Browse the repository at this point in the history
…(s::Int, body::AbstractVector{UInt8}) per JuliaWeb/GitHub.jl#102
  • Loading branch information
samoconnor committed Jan 17, 2018
1 parent 38310b5 commit 2c14d43
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ mutable struct Response <: Message
end
end

Response(s::Int, body::AbstractVector{UInt8}) = Response(s; body=body)
Response(s::Int, body::AbstractString) = Response(s, Vector{UInt8}(body))

Response(bytes) = parse(Response, bytes)

function reset!(r::Response)
Expand Down

0 comments on commit 2c14d43

Please sign in to comment.