Skip to content
Open
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions lib/barrister.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# You can write your own transport class if you want to use another lib
# such as typhoeus. Transports are designed to be pluggable.
require "net/http"
require "net/https"
require "uri"

### Barrister Module
Expand Down Expand Up @@ -395,6 +396,7 @@ def initialize(url)
def request(req)
json_str = JSON::generate(req, { :ascii_only=>true })
http = Net::HTTP.new(@uri.host, @uri.port)
http.use_ssl = (@uri.scheme == 'https')
request = Net::HTTP::Post.new(@uri.request_uri)
request.body = json_str
request["Content-Type"] = "application/json"
Expand Down