Complete the code to set the request method for uploading a binary file in Postman.
pm.request.method = '[1]';
The POST method is used to upload binary files in Postman requests.
Complete the code to set the request body mode to binary in Postman.
pm.request.body.mode = '[1]';
Setting the body mode to 'binary' tells Postman to send the request body as a binary file.
Fix the error in the code to correctly assign the binary file path in Postman.
pm.request.body.binary = { 'src': '[1]' };The 'src' property must be set to the actual file path string where the binary file is located.
Fill both blanks to set the Content-Type header correctly for a binary file upload in Postman.
pm.request.headers.add({ key: '[1]', value: '[2]' });The header key must be 'Content-Type' and the value should be 'application/octet-stream' for binary file uploads.
Fill all three blanks to write a test script that checks if the binary file upload response status is 200 and content-type is correct.
pm.test('Upload successful', () => { pm.response.to.have.status([1]); pm.expect(pm.response.headers.get('[2]')).to.eql('[3]'); });
The test checks that the response status is 200 (OK) and the Content-Type header matches 'application/octet-stream' indicating a successful binary upload.