top of page
Search
  • stephie.john85

How to set a Post Request Using Postman API for Android & iOS?

In this blog, we are gonna explore how to use Postman API to accelerate Mobile Application Development by collaborating the Front end and Back end team with each other effective debugging by reducing the interdependence and use the time effectively.

Postman is an interactive collaboration Application Programming Interface tool that allows the developers, testers, designers, and other project stakeholders to communicate with each other effectively and do scalable API Testing.






6 Factors to choose Postman API?

  1. Postman is a simple application used to access files from anywhere as long as the Postman Tool account is kept logged-in in a particular computer.

  2. Postman lets the users create collections to call Postman APIs. Each collection can have multiple subfolders to manage multiple requests for test suits.

  3. It is an effective collaborative tool to import or export files using a direct link to share collections.

  4. Through parameterization – the collections are tested for multiple environments. This way you can avoid repetition of tests for different environments.

  5. With Automation testing, multiple iterations are done by Collection Runner or Newman to save time and increase efficiency.

  6. Ensures test coverage through checkpoints verifying successful HTTP response.

  7. Postman API supports continuous integration and Debug tests help to monitor the data retrieval and maintain a smooth development process

Working with Postman Requests to execute API’s:

1. Download Postman and install on Android, Windows or Mac OS.

(Click here to learn about Windows Boot Concepts and Its sequence)

2. Create New Requests using Collections.

3.GET Request in Postman:

a) Get request is used to retrieve information from the given URL. Based on the obtained results it indicates the success rate of the test.

b) Sometimes the test result can go unsuccessful due to an invalid request or authentication error.

c) Data cannot be added at the End Point.

4. Request Parameters in Postman.

5. Post Request using Postman:

Post Request API is completely different from GET Request API as the user can manipulate and add data directly at the end point.

Let us see Post Request – Postman API in Detail.

What is the “Post Request Method” in the Postman API?

A POST is a simple HTTP Verb similar to a GET request (This specifies that a client is posting data on the given Endpoint).

A POST request is a method that is used when we need to send some additional information inside the body of the request to the server.

When we send a POST request we generally intend to have some modification at the server such as updating, deletion or addition.

Example of a POST request is the “Login page”.

When you first Sign Up for anything, let say Facebook, you send your personal information such as passwords to the server.

The server creates a new account with the same details and that account is added permanently on the Facebook server.

You just created a new resource on the server.

POST request methods are very popular and are mostly used whenever you are sending some sensitive information such as submitting a form or sending sensitive information to the server.

Benefits of Using Postman API Testing Tool:

As mentioned above Postman is a simple testing tool to test multiple APIs. Testing is carried out by sending requests to the web server and getting the response back.

Key features of Postman are – Increased accessibility, Collaboration, Continuous Integration and use of collections.

Advantages:

  • By creating the account in Postman, the collections are made available online anywhere, anytime.

  • In postman the data request can be parameterized.

  • Tests can be created to verify postman results.

  • Data Collections can be made safely using Newman or Collection Runner.

Why Postman?

|World Build their API on Postman!

1. It is Free Tool – Open Source: Just sign up and you are all ready to download for FREE on your computer.

2. Has got built-in support for wide data formats like OpenAPI GraphQK and RAML. Make API Calls like REST,SOAP or Plain HTTP with easy intercepts including the largest response.


How to Set a Post Request Using Postman API for Android?








How to set a Post Request Using Postman API for iOS?


Notes: url = Your API URL

let url = APIList().getUrlString(url: .CREATE_ACCOUNT)

Notes: header = Your API headers are include in the part

let headers : HTTPHeaders = [

“Content-Type”:CONTENT_TYPE,

“lang”:”en”

]

Natoes: parameter = the field in the body of the API

let parameter : Parameters = [

“email”:emailTxt.text!,

“countryCode”:countryCodeTxt.text!.alphanumeric,

“mobileNumber”:mobileTxt.text!,

“password”: passwordTxt.text!,

“name”:usernameTxt.text!,

“profilePic”:ConstantManager.appConstant.profilePic,

“insurence_id”:insuranceNoTxt.text!,

“insurence_class”:ConstantManager.appConstant.branchID!,

“insurence_com”: ConstantManager.appConstant.companyID!

]

showLottie()

Notes: connection post method to retrieve the data from user and send to the database

connection.requestPOST(url, params: parameter, headers: headers, success:

{

(data) in

self.hideLottie()

if data[“error”].boolValue

{

self.showAlertError(titleStr: CONSTANT.OOPS, messageStr: data[“message”].stringValue)

}

else

{

UserDefaults.standard.setLoggedIn(value: true)

UserDefaults.standard.setStatus(value: data[“data”][“admin_approve”].stringValue)

UserDefaults.standard.setAccessToken(value: data[“data”][“token”].stringValue)

UserDefaults.standard.setEmailId(value: data[“data”][“email”].stringValue)

UserDefaults.standard.setMobileNo(value: data[“userDeatils”][“mobile”].stringValue)

UserDefaults.standard.setCountryCode(value: data[“data”][“countryCode”].stringValue)

UserDefaults.standard.setUserId(value: data[“data”][“id”].stringValue)

UserDefaults.standard.getinsurenceNo(value: data[“data”][“insurence_id”].stringValue)

UserDefaults.standard.getinsurenceClass(value: data[“data”][“insurence_class”].stringValue)

UserDefaults.standard.getinsurenceCompany(value: data[“data”][“insurence_com”].stringValue)

UserDefaults.standard.setName(value: data[“data”][“name”].stringValue)

UserDefaults.standard.setProfilePic(value: data[“data”][“profilePic”].stringValue)

UpdateDeviceToken()

self.moveHome()

}

})

{

(error) in

self.hideLottie()

self.showAlertError(titleStr: CONSTANT.OOPS, messageStr: error.localizedDescription)

}

Note: user defaults. standard is used to store the data for user application. It did not erase until the user uninstalled the application.

Learn about How to manage an error messageOperation not permitted” in mac iOS Terminal





In the field, the data entered by the user gets sent to the database using the API POST method.


Conclusion:

In this article, we have learnt about How to set a Post Request Using Postman API for Android and iOS. At Lia infraservices, we use API’s to collaborate with our Mobile Application Development Company in Chennai to share and manage multiple environments with ease.

11 views0 comments
bottom of page