mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.9 KiB
2.9 KiB
valid suggest query
Generated: Thu Sep 18 2014 14:53:39 GMT+0100 (BST)
Request
{
"protocol": "http:",
"host": "localhost",
"method": "GET",
"port": 3100,
"path": "/suggest?input=a&lat=0&lon=0"
}
Response
Status: 200
{
"x-powered-by": "mapzen",
"charset": "utf8",
"cache-control": "public,max-age=60",
"server": "Pelias/0.0.0",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET",
"access-control-allow-headers": "X-Requested-With,content-type",
"access-control-allow-credentials": "true",
"content-type": "application/json; charset=utf-8",
"content-length": "1248",
"etag": "W/\"H7TGcVqWuu8sAb6aBhpd6A==\"",
"date": "Thu, 18 Sep 2014 13:53:39 GMT",
"connection": "close"
}
{
"date": 1411048419796,
"body": [
{
"text": "ACRELÃNDIA, Brazil",
"score": 1,
"payload": {
"id": "admin2/708:adm2:br:bra:acrel__ndia",
"geo": "-66.908143,-9.954353"
}
},
{
"text": "ALTA FLORESTA, Brazil",
"score": 1,
"payload": {
"id": "admin2/2986:adm2:br:bra:alta_floresta",
"geo": "-56.404593,-10.042071"
}
},
{
"text": "ALTO ALEGRE, Brazil",
"score": 1,
"payload": {
"id": "admin2/4611:adm2:br:bra:alto_alegre",
"geo": "-62.627879,3.103540"
}
},
{
"text": "ALTO PARAÃSO, Brazil",
"score": 1,
"payload": {
"id": "admin2/4584:adm2:br:bra:alto_para__so",
"geo": "-63.418743,-9.697774"
}
},
{
"text": "ALVARÃES, Brazil",
"score": 1,
"payload": {
"id": "admin2/832:adm2:br:bra:alvar__es",
"geo": "-65.296384,-3.674615"
}
},
{
"text": "AMAJARI, Brazil",
"score": 1,
"payload": {
"id": "admin2/4610:adm2:br:bra:amajari",
"geo": "-62.710104,3.724864"
}
},
{
"text": "AMAZONAS, Brazil",
"score": 1,
"payload": {
"id": "admin1/3232:adm1:br:bra:amazonas",
"geo": "-64.949558,-3.785708"
}
},
{
"text": "ANAMÃ, Brazil",
"score": 1,
"payload": {
"id": "admin2/834:adm2:br:bra:anam__",
"geo": "-61.683670,-3.473836"
}
},
{
"text": "ANORI, Brazil",
"score": 1,
"payload": {
"id": "admin2/835:adm2:br:bra:anori",
"geo": "-62.182138,-4.154809"
}
},
{
"text": "APIACÃS, Brazil",
"score": 1,
"payload": {
"id": "admin2/2992:adm2:br:bra:apiac__s",
"geo": "-57.803447,-8.583036"
}
}
]
}
Tests
✓ 200 ok
response.statusCode.should.equal 200
✓ valid response
now = new Date().getTime()
should.exist json
should.not.exist json.error
should.exist json.date
json.date.should.be.within now-1000, now+1000
should.exist json.body
json.body.should.be.instanceof Array