Skip to content

Instantly share code, notes, and snippets.

@vdespa
Created September 26, 2019 18:31
Show Gist options
  • Save vdespa/244e96b47a2c3e6000dfc2df9f2c69cc to your computer and use it in GitHub Desktop.
Save vdespa/244e96b47a2c3e6000dfc2df9f2c69cc to your computer and use it in GitHub Desktop.
Postman collection with variable for the file name
{
"info": {
"_postman_id": "d7e89525-371a-4d96-8683-ea3d9a40c0ca",
"name": "Upload",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "https://hookb.in/OeZner0EOYTyVylW6bWj",
"event": [
{
"listen": "prerequest",
"script": {
"id": "38f6fef9-bee5-429f-b030-7a272315bfc0",
"exec": [
"pm.globals.set(\"fileName\", \"random.js\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": "{{fileName}}"
}
]
},
"url": {
"raw": "https://hookb.in/OeZner0EOYTyVylW6bWj",
"protocol": "https",
"host": [
"hookb",
"in"
],
"path": [
"OeZner0EOYTyVylW6bWj"
]
}
},
"response": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment