Node.js
Loopback - REST-baserad kontakt
Sök…
Introduktion
Vila baserade kontakter och hur man hanterar dem. Vi vet alla att Loopback inte ger elegans till REST-baserade anslutningar
Lägga till ett webbaserat kontakt
// Det här exemplet får svaret från iTunes
{
"resten": {
"name": "vila",
"kontakt": "vila",
"debug": sant,
"alternativ": {
"useQuerystring": true,
"timeout": 10000,
"rubriker": {
"accepterar": "applikation / json",
"content-type": "applikation / json"
}
},
"operationer": [
{
"mall": {
"method": "GET",
"url": "https://itunes.apple.com/search",
"fråga": {
"term": "{nyckelord}",
"country": "{country = IN}",
"media": "{itemType = music}",
"limit": "{limit = 10}",
"explicit": "falskt"
}
},
"funktioner": {
"Sök": [
"nyckelord",
"Land",
"Objekttyp",
"begränsa"
]
}
},
{
"mall": {
"method": "GET",
"url": "https://itunes.apple.com/lookup",
"fråga": {
"jag gjorde}"
}
},
"funktioner": {
"findById": [
"Id"
]
}
}
]
}
}
Modified text is an extract of the original Stack Overflow Documentation
Licensierat under CC BY-SA 3.0
Inte anslutet till Stack Overflow