diff --git a/service/lib/agama/http/clients/scripts.rb b/service/lib/agama/http/clients/scripts.rb index 7a78954f1..4e9cd2256 100644 --- a/service/lib/agama/http/clients/scripts.rb +++ b/service/lib/agama/http/clients/scripts.rb @@ -21,6 +21,7 @@ require "uri" require "net/http" +require "json" module Agama module HTTP @@ -28,12 +29,12 @@ 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 @@ -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