Specify locale for Faker.js library

Number of APIs: 1

This collection shows you how to set the locale for the faker.js library to get dummy data specific to a locale. This question came up as a comment in [this blog post]

Use the pre-request script to import the faker library from CDN. Next specify the locale you want (see the faker.js docs for available locales.)

The pre-request script makes a call to the faker library to save the desired values as a collection level variable, which can then be used in the actual request.

  1. Get French data GET http://postman-echo.com/get?name={{name}}&phone number={{phoneNumber}}&address={{streetAddress}}