First steps with FIWARE

0

I am trying to make my first steps with FIWARE and I am not able to make a correct POST request with this example:

POST http://localhost:1026/v2/entities/

Headers:

{
    'Content-Type':        'application/json',
    'Fiware-Service':      'tourguide'
    'Fiware-ServicePath':  '/Franchise1'

}

{
    "id": "sample-id",
    "type": "Restaurant",
    "address": {
        "type": "PostalAddress",
        "value": {
            "streetAddress": "Cuesta de las Cabras Aldapa 2",
            "addressRegion": "Araba",
            "addressLocality": "Alegría-Dulantzi",
            "postalCode": "01240"
        }
    },
    "aggregateRating": {
        "type": "AggregateRating",
        "value": {
            "ratingValue": 3,
            "reviewCount": 98
        }
    },
    "capacity": {
        "type": "PropertyValue",
        "value": 100      
    },
    "department": {
        "type": "Text",
        "value": "Franchise1"            
    },
    "description": {
        "type": "Text",
        "value": "Sample description"            
    },
    "location": {
        "type": "geo:point",
        "value": "42.8404625, -2.5123277"
    },
    "name": {
        "type": "Text",
        "value": "Sample-restaurant"
    },
    "occupancyLevels": {
        "type": "PropertyValue",
        "value": 0,
        "metadata": {
            "timestamp": {
                "type": "DateTime",
                "value": "2016-09-19T06:32:15.901Z"
            }
        }
    },
    "priceRange": {
        "type": "Number",
        "value": 0
    },
    "telephone": {
        "type": "Text",
        "value": "945 400 868"
    }
}

It is an example of the FIWARE documentation itself.

link

    
asked by Drouiz 09.08.2017 в 22:02
source

1 answer

0

Good morning,

I recommend to start with Fiware that you use a client like Postman to make the Post, Get, etc. requests.

I attach two images as would be the header and body of the request:

Code generated by PostMan.

POST /v2/entities/ HTTP/1.1
Host: 150.--.--.--:1026
Accept: application/json
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: d38c4aa4-b7ec-8039-2461-fc0efcd9d6bc

{
  "id": "S_Temp001",
  "type": "Temperatura",
  "Tem_int": {
    "value": 23,
    "type": "Float"
  },
  "Tem_out": {
    "value": 720,
    "type": "Integer"
  }
}

I'm fighting a lot with Fiware, if it's not clear to you, ask me.

Greetings and luck.

    
answered by 28.11.2017 в 13:42