简体   繁体   中英

How to use Postman and the FIWARE API?

Some of the tutorials of the FIWARE Wednesday Webinars eg this one https://youtu.be/SP0zFdTybA4 , show the use of Postman to interact with the FIWARE API. I am not sure what configuration needed to get it up and running.

I could use the curl command but when run the postman. I am new to both FIWARE API and Postman.

Can anyone show me how to configure Postman to use with FIWARE API? Thanks.

  1. Install Postman
  2. Check out one of the Tutorials
  3. At the top of the Tutorial, there is the option "Run in Postman"
  4. Postman will open and you will see the collection eg "FIWARE Getting started" 邮递员集合
  5. If you Fiware system runs at a different server than localhost, eg example.com you need to modify the variable {{orion}} in the collection
  6. Click on the three dots at the collection, then choose Edit and in the Variables tab overwrite Current value with your server address.
  1. Install and launch Postman.
  2. Change the request operation as required(POST, GET, APPEND, etc).
  3. Enter the public IP Address of required node, with full path. For example:

    • In case of POST request to iotagent-json: http://<Ip Address>:7896/iot/json?i=<deviceID>&k=<api-key>
    • In case of GET request from Orion context-broker: http://<Ip Address>:1026/v2/entities
  4. Add headers(-H) in Headers tab:

    • Add fiware-service , fiware-servicepath , content-type and its values.
    • Default value of fiware-service is openiot and fiware-servicepath is / .
  5. If request type is POST, add data payload in Body tab, also choose aplication/json as content type from the dropdown menu.
  6. Send to hit the given API.

One can also import CURL request statement in Postman:

  1. Open Postman Application
  2. Click Import, located on top-left corner
  3. From Import, select tab “Paste Raw Text”
  4. Copy and paste the CURL request data to the given input area below “Paste Raw Text” tab.
  5. Click Import located at the bottom-right
  6. Check whether data type is application/json or not in body tab, if not select application/json from the drop-down menu in body tab.
  7. Click “Send” button to post the data."

For more detail, refer to my config:

  1. POST Request on iotagent-json
  2. GET Request from Orion context broker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM