卷曲错误

时间:2018-07-20 12:47:36

标签: curl iot

我正在尝试使用curl将一些数据发送到物联网服务。

我已经配置了PATH并且可以访问curl。

但是当我尝试使用下面的链接来拖延数据(测量)时,我会收到一条消息:

curl -v -H "Content-Type: application/json" -d "{ \"capabilityAlternateId\": \"201\", \"sensorTypeAlternateId\": \"857\", \"measures\": [{\"Inctemp\": \"25\"}] }"http://127.0.0.1:8699/measures/1c2639b9c113ef54

curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

只需最后确定此问题,即可完全回答: 您的请求很好,除了语法错误很小。

您的代码:

lat,long

正确的代码:

searchQuery = [
  { "postLocationType": { $exists: true } }, 
  { "languageType": mongoose.Types.ObjectId(body.languageType) }, 
  { typeId }, 
  { subTypeId }, 
  { "discountExpires": 
  { $gte: new Date() } }];
$geoNear: {
   near: { type: "Point", coordinates: [long, lat] },
   distanceField: "dist.calculated",
   maxDistance: searchUnit === config.SEARCH_UNIT_KM ? maxKms : maxMiles,
   query: { $and: searchQuery }, //condition for checking postTitle,typeId and post should not be exired.
   spherical: true,
   distanceMultiplier: searchUnit === config.SEARCH_UNIT_KM ? distanceInKm : distanceInMiles
   } 

(请注意,curl -v -H "Content-Type: application/json" -d "{ \"capabilityAlternateId\": \"201\", \"sensorTypeAlternateId\": \"857\", \"measures\": [{\"Inctemp\": \"25\"}] }"http://127.0.0.1:8699/measures/1c2639b9c113ef54 选项curl -v -H "Content-Type: application/json" -d "{ \"capabilityAlternateId\": \"201\", \"sensorTypeAlternateId\": \"857\", \"measures\": [{\"Inctemp\": \"25\"}] }" http://127.0.0.1:8699/measures/1c2639b9c113ef54 的末尾与请求URL -d的开头之间的空格