Ruby
Ruby request method
get
https://neko-love.xyz
/api/v1/:endpoint
Get Endpoint

Example:

1
require 'net/http'
2
require 'uri'
3
require 'json'
4
5
def nekoGET(url)
6
return JSON.parse(Net::HTTP.get_response(URI(url)).body)
7
rescue StandardError => e
8
return { "error" => "failed to get response : #{e.message}" }
9
end
10
11
#Methode call function "api_get"
12
nekoGET("https://neko-love.xyz/api/v1/neko")["url"]
Copied!
Last modified 1yr ago
Copy link