class Pytty::Client::Api::Port
Public Class Methods
run(id:, from:, to:)
click to toggle source
# File lib/pytty/client/api/port.rb, line 5 def self.run(id:, from:, to:) internet = Async::HTTP::Internet.new headers = [['accept', 'application/json']] body = { from: from, to: to }.to_json response = internet.post("#{Pytty::Client.host_url}/v1/port/#{id}", headers, [body]) [response, JSON.parse(response.body.read)] ensure internet.close end