I recently learned how to upload a file in the body of a POST request while playing around with IBM Developer Model Asset Exchange: Weather Forecaster
If you are interested in open-source deep learning models that contain free, deployable, and trainable code be sure to check out the IBM Model Asset Exchange!
The Weather Forecaster Model takes hourly weather data in text file format as input and returns hourly weather predictions for variables such as temperature or wind speed.
You can run this model locally using docker:
Steps to build :
git clone https://github.com/IBM/MAX-Weather-Forecaster.git cd MAX-Weather-Forecaster docker build -t max-weather-forecaster . docker run -it -p 5000:5000 max-weather-forecaster
Once your model is built locally you can use the
model/predict endpoint to load test data.
In postman, I discovered that you can do this by working with form-data in the body of your post request.
Steps to upload file in POST request :
Select Body > form-data > enter a parameter name for file > click drop down File > add file
This feature is slightly hidden, so if there is anyone out there that is trying to play with files as you post your request, I hope this quick tutorial helps!
If you’re interested in playing around with this model and the data associated , be sure to fork my Model Asset Exchange Collections