Wednesday, March 27, 2019

How to use Postman to call API( Azure Web API)?

it is not a rocket science to setup the postman. but it is a good practice to learn how to do it. since it is very useful for web api testing against the API hosting in the cloud.


       First set up the token generator request
  •        change the Method to Post
 
  •        click on the Body tab, click on click on the bulk edit

  •        paste the following setting to the text area
   
         grant_type:client_credentials
         resource:https://webAPIHostServer
         client_id:web_Api_Client ID
         client_secret:web_API_Client Secrete


       Second set up content query request
     we have to change to Method call to be GET.
     we only has to setup the header section
        Authorization:Token generate from the token generator
        Ocp-Apim-Subscription-Key: the key from the cloud


      Third set up the action query request
     we need to setup both the header and the body section
   
in the header section, we only have to copy from search query setup.

then in the body section, Post the JSon Data in the text area and select JSON(application/json) for data format



now we can have a Postman Ready for web api query and testing.

No comments:

Post a Comment