September 26, 2022
API tests now support binary request bodies using a file upload!
Previously, API tests were required to use textual request bodies, such as XML or JSON, which could not be reused across steps or other API tests. The new binary request type will enable users to test API requests containing binary data, such as PNG image files and ZIP files, and allow the reuse of files from your mabl workspace.
You can also import Postman collections that have binary file upload requests. The files referenced in the Postman collection will automatically be uploaded when the test is saved.
How it works
To start using this feature, edit a new or existing API test and click on the plus sign to add a new request step. In the Request details section, add the request method and endpoint, and then select the "binary" request type in the Body tab.
An API Test with a binary request type using an existing File Upload in the user's workspace
You may select a new file from your computer or use an existing file from your mabl workspace. Upon saving the test, any new files will be uploaded to the mabl cloud to enable cloud runs. You can manage file uploads in your workspace by going to File Uploads page in the app: Configuration > File Uploads
.
Files may not be larger than 15MB and must use a common file extension
To learn more about configuring request details, please see our guide
And keep an eye out for future improvements to API Testing and File Uploads in the coming weeks!