Skip to content

Commit

Permalink
fix(ruby): fix scripts client
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Oct 17, 2024
1 parent b7c35c1 commit e4feeaf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions service/lib/agama/http/clients/scripts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@

require "uri"
require "net/http"
require "json"

module Agama
module HTTP
module Clients
# HTTP client to interact with the scripts API.
class Scripts
def initialize
@base_url = "http://localhost/api"
@base_url = "http://localhost/api/"
end

# Runs the scripts
def run(group)
Net::HTTP.post(uri("/api/scripts/run"), group, headers)
Net::HTTP.post(uri("scripts/run"), group.to_json, headers)
end

private
Expand All @@ -44,8 +45,8 @@ def uri(path)

def headers
@headers = {
Accept: "application/json",
Authorization: "Bearer #{auth_token}"
"Content-Type": "application/json",
Authorization: "Bearer #{auth_token}"
}
end

Expand Down

0 comments on commit e4feeaf

Please sign in to comment.