List all albums
curl --request GET \
--url http://localhost:6063/albumsimport requests
url = "http://localhost:6063/albums"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:6063/albums', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6063/albums")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"id": "cmodxew8w0053pdmdmro8vx0w",
"title": "2014 Forest Hills Drive",
"artist": "J. Cole",
"year": 2014,
"year_string": "2014-12-09",
"album_art": "216ccc791352fbbffc11268b984db19a.jpg",
"md5": "7efed3c16a2ea54a2c090e40f03107d4",
"artist_id": "cmodw19po0005pdmd6k9mwauv",
"label": null,
"copyright_message": "℗ 2014 Cole World/Interscope Records"
},
{
"id": "cmjodpk0r00j8pdoc5r5eko46",
"title": "21 Reasons (feat. Ella Henderson)",
"artist": "Nathan Dawe",
"year": 2019,
"year_string": "2019-05-31",
"album_art": "53682046896b8c9c6118c169cfd03ff8.jpg",
"md5": "3997d22d81a895c867827ef6f4f83477",
"artist_id": "cmjodpk0r00j7pdocuh1vu2vx",
"label": null,
"copyright_message": "under exclusive licence to Warner Music UK Limited, ℗ 2020 Nathan Dawe"
}
]Albums
List all albums
GET
/
albums
List all albums
curl --request GET \
--url http://localhost:6063/albumsimport requests
url = "http://localhost:6063/albums"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:6063/albums', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6063/albums")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"id": "cmodxew8w0053pdmdmro8vx0w",
"title": "2014 Forest Hills Drive",
"artist": "J. Cole",
"year": 2014,
"year_string": "2014-12-09",
"album_art": "216ccc791352fbbffc11268b984db19a.jpg",
"md5": "7efed3c16a2ea54a2c090e40f03107d4",
"artist_id": "cmodw19po0005pdmd6k9mwauv",
"label": null,
"copyright_message": "℗ 2014 Cole World/Interscope Records"
},
{
"id": "cmjodpk0r00j8pdoc5r5eko46",
"title": "21 Reasons (feat. Ella Henderson)",
"artist": "Nathan Dawe",
"year": 2019,
"year_string": "2019-05-31",
"album_art": "53682046896b8c9c6118c169cfd03ff8.jpg",
"md5": "3997d22d81a895c867827ef6f4f83477",
"artist_id": "cmjodpk0r00j7pdocuh1vu2vx",
"label": null,
"copyright_message": "under exclusive licence to Warner Music UK Limited, ℗ 2020 Nathan Dawe"
}
]⌘I