Uploading Files
Key Concepts
Instead of posting JSON or similar text-based data, you can use the File Uploads to send more complex data in your API requests.
Multi-part form data
You can choose to upload a file, or to create multi-part from data that encapsulated multiple files
![Screenshot 2022-12-02 at 11.54.39 AM.png 1298](https://files.readme.io/f5148d2-Screenshot_2022-12-02_at_11.54.39_AM.png)
Handling File Uploads
You can upload files from the Files link in the Advanced section on the left of each APImetrics page.
Click on the +Upload File button. This will open a file picker in your browser to upload.
If you wish to send Multi-part data, you can build up the data using the form-builder. Upload each file and give the each field a name. This will save the full multi-part message as one file.
![Screenshot 2022-12-02 at 11.50.03 AM.png 1764](https://files.readme.io/f86a1ed-Screenshot_2022-12-02_at_11.50.03_AM.png)
Using the File in an API call
When editing the API call, expand the "Body..." section.
Then select the File / Binary content type, this will expose the file picker:
![Screenshot 2022-12-02 at 11.50.52 AM.png 1432](https://files.readme.io/a353fbe-Screenshot_2022-12-02_at_11.50.52_AM.png)
Then select the file you wish to use.
Remember to Click "Save" to store your changes.
![Screenshot 2022-12-02 at 11.51.04 AM.png 1424](https://files.readme.io/2a2a074-Screenshot_2022-12-02_at_11.51.04_AM.png)
POST and PUT only
Note that you must use an HTTP method of POST or PUT to upload content with the request
Updated over 1 year ago