Get an album by id
curl --request GET \
--url http://localhost:6063/albums/{id}import requests
url = "http://localhost:6063/albums/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:6063/albums/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6063",
CURLOPT_URL => "http://localhost:6063/albums/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:6063/albums/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:6063/albums/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6063/albums/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"album_art": "fd2f91b0204eb7d7bb57573c86d9511d.jpg",
"artist": "Charli xcx",
"artist_id": "cmfcfqx3w002dwg08lrasptzo",
"copyright_message": null,
"id": "cmffj228r0009wgc76zjd7rtr",
"label": null,
"md5": "2896ca6b64216f891514d2d746754ea1",
"title": "how i'm feeling now",
"year": 2020,
"year_string": "2020-05-15"
}Albums
Get an album by id
GET
/
albums
/
{id}
Get an album by id
curl --request GET \
--url http://localhost:6063/albums/{id}import requests
url = "http://localhost:6063/albums/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:6063/albums/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6063",
CURLOPT_URL => "http://localhost:6063/albums/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:6063/albums/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:6063/albums/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6063/albums/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"album_art": "fd2f91b0204eb7d7bb57573c86d9511d.jpg",
"artist": "Charli xcx",
"artist_id": "cmfcfqx3w002dwg08lrasptzo",
"copyright_message": null,
"id": "cmffj228r0009wgc76zjd7rtr",
"label": null,
"md5": "2896ca6b64216f891514d2d746754ea1",
"title": "how i'm feeling now",
"year": 2020,
"year_string": "2020-05-15"
}⌘I