API Testing With Postman

What is Postman?

  • Postman is a rest client which is an API development suite with powerful features
  • Postman is a google chrome application for testing API calls which can also be used with the Developer Tools Utility to test these API calls and not have to worry about importing any files or setting up Authentication.
  • Postman allows user to create and save simple and complex HTTP/S Request.
  • It’s available as a Chrome extension and as a native app for Mac, Windows and Linux.

API Execute throw postman

Let’s look at how API call requests throw postman.

  • First we execute the GET Method using postman. I have one GET API http://localhost:1456/Service1.svc/Getstring that would be executed with the postman. Please follow the below listed steps.
  • Launch Postman.

  • Enter the endpoint URL of a request in the address bar and choose the appropriate HTTP method from the drop-down list to the left of the address bar.

  • Choose the Headers tab. Optionally, add any required custom headers. For example, if API keys are enabled, you can set the key as Content-type and value as application-json

  • Choose Send to submit the request

  • Now you can see the request response in image.

  • Now we execute POST method through postman
  • Post method API calls Url - http://localhost:1456/Service1.svc/Additem
  • Enter the endpoint URL of a request in the address bar and choose the appropriate HTTP method from the drop-down list to the left of the address bar.

  • Here we have four parameters that we insert (C_DATE,C_USER_NAME,C_ITEM,C_USER_ID)
  • Prepare one JSON formats (key:value) for these fours parameters like this {"C_DATE":"07/20/2017","C_USER_NAME": "Arvind" ,"C_ITEM":"Milk" ,"C_USER_ID":2}
  • Copy this JSON string in the Body in Row section show in image.

We set result as if the data saved successfully that response returns the 1 value otherwise it returns the 0, Here response returns 1 so finally save the data using the API.

Up Next
    Ebook Download
    View all
    Learn
    View all