Loading...
Net/HTTP is a default Ruby class perfect for integrating with Apito's REST API tools and database API. When working with our instant API builder, it is most commonly used along with URI to make requests to your build API tool endpoints.
Tip:
Always remember to replace
API_SECRETin the Bearer Token andproject-idin the URL with the correct values from the Apito console.
If you are unsure where to find your API secrets and endpoints for your project, visit this page.
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.apito.io/secured/rest/project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Bearer API_SECRET'
response = http.request(request)
puts response.read_body