Found 75 Articles for REST API

How to Run WebDriver in Headless Mode using Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:24:06

228 Views

We can run webdriver in headless mode. This is achieved with the HTMLUnitDriver which is the fastest webdriver among all the other browser drivers.Post Selenium 2.53 version, the HTMLUnitDriver jar should be added explicitly in the project. To add the required dependency, the below steps need to be followed −Navigate to − https://github.com/SeleniumHQ/htmlunit-driver/releases.Click on the jar marked in the below image.Right-click on the project and choose the option Build path. Then click on Configure Build Path.Click on Java Build Path and select the Libraries tab. Click on the Add External JARs button. Then add the downloaded HTMLUnitDriver jar. Finally, click ... Read More

OAuth 2.0 Authorization with Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:22:53

235 Views

With the help of OAuth 2.0, we shall first obtain an access token for an API. This token shall be used for authentication of all the future requests. The data access with OAuth 2.0 differs from one API access provider to another. However, it generally consists of sending requests back and forth between the user, API and the client.OAuth 2.0 FlowThe client sends a request to authorize the access to the data for the user.If the user permits access, then the application requests an access token from the service provider. This is done by sending the access permit from the ... Read More

How to use Sessions in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:22:01

3K+ Views

We can use sessions in Postman. To create a session the follow the below steps −Step1 − Click on the eye icon appearing to the right upper corner of the Postman application. Then click on Edit in the Globals section.Step2 − Enter u in the VARIABLE field. Set the INITIAL VALUE(to be synced with Team Workspace) as test123 and CURRENT VALUE(local to our Postman instance unless the changes are persisted) as Test.Step3 − Click on the eye icon again, the Global variable u gets displayed. Now, click on the CURRENT VALUE field and update its value to Test123.With this set ... Read More

How to use dynamic GUID in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:21:23

3K+ Views

We can use dynamic GUID in Postman. This can be utilized in the request URL, Body or Headers by simply adding the value {{$guid}}. It does not need any declaration or initialization.Thus {{$guid}} can be used directly in Postman without any requirement of prior processing of the variable. Postman has support for dynamic variables. GUID is one such instance.We need not allocate memory or value for this variable. The syntax is {{$guid}}. Besides GUID, there are other dynamic variables like randomInt, timestamp, and so on in Postman.Usage of Dynamic GUID in URLUrl − https://www.tutorialspoint.com/index.htm?n={{$guid}}The above image shows the usage of ... Read More

Manually Generating GUID in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:20:45

2K+ Views

We can manually generate GUID in Postman with the help of the steps listed below −Step1 − Input the endpoint − https://www.tutorialspoint.com/index.htm in the address bar.Step2 − Add the below script under the Pre-request Script tab −var u= require('uuid') var ud = u.v4() console.log(ud)In the above script, require is used in JavaScript for loading a module. Then, the version 4 of the GUID is stored in the variable ud. Finally, the generated GUID is printed in the console.It must be remembered that we cannot use a variable with name guid within a Pre-request Script in Postman. However, the guid can ... Read More

GUID in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:26:40

697 Views

GUID means Global Unique Identifier. It is in the form of a hexa-decima digit which is separated by hyphen. It helps to achieve distinctiveness due to this even if multiple people are creating the GUID simultaneously, the chance of having a duplicate GUID is rare.To generate a random value, using GUID, the format is −{    "name": "{{$guid}}" }On sending a request, it would produce a random value.GUID is a value with 128 bits having a structure defined in RFC4122. The structure of GUID is uncomplicated and simple for generation.The format of a GUID is shown below −xxxxxxxx-xxxx-Axxx-Bxxx-xxxxxxxxxxxxHere, A is ... Read More

What are Sessions in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:19:56

192 Views

A session is a temporary fold that holds values of variables. They can be utilized for an existing instance and their scope is local. We can update the session variable value for the purpose of sharing workspace.With Postman, we can have the provision for local session sharing. Though a Collection is sharable among teams, their sessions are not. Tokens have to be generated while a task is being by more than one team simultaneosuly.A session gives a local scope to a user within his Workspace and any changes he commits does not impact the server. A session is capable of ... Read More

How to share Session ID Cookie with another request using Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:19:24

764 Views

We can share session id cookies with another request. To achieve this, we shall first save the cookie session id obtained by executing a request. Then, this cookie session id shall be passed as a header to the following request.Step1 − Enter an endpoint − https://www.amazon.com/ in the address bar and execute a GET request.Step2 − Once a Response is received, navigate to the Cookies tab and note the value of the session-id as highlighted in the below image.Step3 − Store the value of the session-id and set it as a Global variable with the help of the script below ... Read More

What are Scripts In Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:17:51

462 Views

Postman is developed on Node.js that gives dynamic characteristics to Collections and requests. We can create test suites, execute requests having changing parameters, send data in between requests, and so on.A JavaScript can be associated with a request twice. Once before the actual request has been sent(as a pre-condition script added under the Pre-Request Scripts tab)and after the Response from the request has been received (as a test script added under the Tests tab).Let us send a GET request along with Pre-Request and Test scripts.Pre-Request Script −console.log("Tutorialspoint - Postman")Testsconsole.warn("Warning message in console") console.log("Logging message in console") console.info("Info message in console") ... Read More

How to Generate API Documentation in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 12:52:12

399 Views

We can generate API Documentation in Postman. This is done by most of the companies to help the developers in understanding the behavior of an API and guide them. An API is usually created for internal use and for third party developers.The steps to create an API Documentation are given below −Step1 − Click on the arrow to the right of the Collection name in the sidebar. Then click on Add a description.Step2 − An input field shall come up. Type a description then click on the Save button.Step3 − Click on the three dots beside the Run button. Then ... Read More

Advertisements