ruby - How do i pass parameters as well as set headers with rest_client in http api call -
with rest_client gem
I have to pass the parametes and also have to set the header of the header parameter- {"Id" = & gt; {"Id" => 376373}, "name" = & gt; "Test workflow", "playbook" = & gt; [{"Name" = & gt; "Shell_book.yml"}]} header- {accept> Application / Jason, Content-type = & gt; App / Jason, Mode = & gt;
Please suggest how to do this - RestClient.put (@@ host + '/ workflow / agentless', {: params => {"module" => {"id" = & Gt; 376373}, "name" = & gt; "test workflow", "playbook" => [{"name" => "shell_book.yml"}}}}) < / Div>
The third parameter is.
Value:
response = RestClient.put (url, request:, content_type = & gt ;: json ,: accept =>: json)
Comments
Post a Comment