POST: Multipart Upload
Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.
The following instructions are to show how to make a POST
call with an entire file included in the data.
- This feature is only available on-premises as of API Fortress version 20.2.0.
- This feature also requires that you update the
remotedownloadagent
to the latest version as well.
Mounting a Volume
For multipart, API Fortress will look for files in the /data
directory, so you'll have to mount a volume to the /data
directory. For example, if you're using docker-compose
, it's done like this:
-
Navigate to the
/core/
directory. -
Stop
apifortress
by issuing the following command:sudo docker-compose stop apifortress
-
Open the
docker-compose.yml
file. -
There is a section labeled “#APIFORTRESS DASHBOARD”, at the bottom of this section there will be a
volumes
section. -
Here you will see
# - ./data:/data
you can uncomment this line by getting rid of the#
-
This will create a folder called
data
in the/core/
directory.
volumes:
- ./tomcat_conf/conf:/usr/local/tomcat/conf
# - ./bin:/usr/local/tomcat/bin
- ./data:/data
-
Now start the
apifortress
service again by issuing the following command:sudo docker-compose up -d apifortress
Make a Multipart POST Call
Now that we have a directory mounted we can make the POST
call using a file from the /data/
folder.
- You can add a “post parameter” to your
POST
call to load the file into. - Give the post parameter a name and craft the value using the following notation:
@file:filename.extension
. - If the name matches a file in the
/data/
directory, then the whole form becomes aform-data
type, and the file will be uploaded as a multipart.