Complete the code to create a mock server in Postman using the correct method.
pm.mockServer.[1]({ url: 'https://api.example.com', name: 'Test Mock' });
The create method is used to create a new mock server in Postman.
Complete the code to set the mock server's environment variable correctly.
pm.environment.set('[1]', 'mock_server_id');
The environment variable mockServerId is commonly used to store the mock server's unique ID.
Fix the error in the code to correctly send a mock response with status 200.
pm.mockServer.sendResponse({ status: [1], body: { message: 'Success' } });The status code should be a number 200, not a string or other type.
Fill both blanks to create a mock server and assign its ID to an environment variable.
const mockServer = pm.mockServer.[1]({ url: 'https://api.test.com' }); pm.environment.set('[2]', mockServer.id);
Use create to make the mock server, and store its ID in mockServerId.
Fill all three blanks to define a mock response with status 201, a JSON body, and a header.
pm.mockServer.sendResponse({ status: [1], body: [2], headers: [3] });Status 201 means resource created, the body is a JSON string, and headers include content type.