Answers for "call the api from ruby"

0

call the api from ruby

# httpx2.rb
require "httpx"

response = HTTPX.post("https://jsonplaceholder.typicode.com/posts", :json => {'title' => 'foo', 'body' => 'bar', 'userID' => 1})
puts response.body if response.status == 201
Posted by: Guest on August-30-2021

Browse Popular Code Answers by Language