我的定义实体设置了location属性,但是当我使用geoqueries时,它不起作用。尝试使用JavaScript SDK和cURL。使用cURL,它返回了400 BAD REQUEST。
这是实体之一:
{
address : 132 Canal St, Boston, MA 02114
created : 1405138421997
location :
latitude : -71.06065690000003
longitude : 42.36471450000001
metadata :
path : /bars/e889e9ee-097a-11e4-98ef-f94f76c7327e
modified : 1405390673164
name : Sports Grill Boston
region : Charlestown
type : bars
uuid : e889e9ee-097a-11e4-98ef-f94f76c7327e
website : http://www.sportsgrilleboston.com/
}
这是cURL命令: curl -v -X GET" https://api.usergrid.com/my-org/my-app/bars?access_token=token&ql=location在42.358431,-71.059773"
的16000之内这里有回报:
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f8bab003c00) send_pipe: 1, recv_pipe: 0
* About to connect() to api.usergrid.com port 443 (#0)
* Trying 54.209.30.241...
* Connected to api.usergrid.com (54.209.30.241) port 443 (#0)
* TLS 1.0 connection using TLS_RSA_WITH_AES_128_CBC_SHA
* Server certificate: api.usergrid.com
* Server certificate: Thawte SSL CA
* Server certificate: thawte Primary Root CA
* Server certificate: Thawte Premium Server CA
> GET /my-org/my-app/bars?access_token=token&ql=location within 16000 of 42.358431,-71.059773 HTTP/1.1
> User-Agent: curl/7.30.0
> Host: api.usergrid.com
> Accept: */*
>
< HTTP/1.1 400 BAD_REQUEST
< Content-Length: 0
< Connection: Close
<
* Closing connection 0
答案 0 :(得分:0)
想出来 - 你需要对请求进行URL编码:
curl -v -X GET "https://api.usergrid.com/my-org/my-app/bars?access_token=token&ql=location%20within%2016000%20of%2042.358431,%20-71.059773"