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

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -