Closed shrikster closed 5 years ago
the HAR spec looks a little different than what is implemented here.
Do you think there's a way to implement it closer to the spec?
"params": [
{
"name": "paramName",
"value": "paramValue",
"fileName": "example.pdf",
"contentType": "application/pdf",
"comment": ""
}
]
List of posted parameters, if any (embedded in
name [string] - name of a posted parameter. value [string, optional] - value of a posted parameter or content of a posted file. fileName [string, optional] - name of a posted file. contentType [string, optional] - content type of a posted file. comment [string, optional] (new in 1.2) - A comment provided by the user or the application.
Sure NP i was debating that issue with myself as well ...
the HAR spec looks a little different than what is implemented here.
I tried my best to be as close to the HAR format as i can. (changed it from form to params) regarding the files - I can't find an example on how will multiple files will be sent .. @jgroom33 maybe you have an example for HAR with multiple files ?
Does the example file.strest.yml work as you expect?
Another option is to use contentType to trigger the file upload. This would eliminate the custom jinja filter.
But, I like the jinja filter approach also. The jinja filter approach avoids handling various contentTypes.
"params": [
{
"name": "paramName",
"value": "..path.to.file",
"fileName": "example.pdf",
"contentType": "application/pdf"
},
{
"name": "paramName",
"value": "..path.to.file",
"fileName": "example.pdf",
"contentType": "application/pdf",
"comment": ""
}
]
any ETA to merge this. This is a really useful patch.
this tool is awesome, but missing the file upload is a pity.
7 #23
I Added support for sending form data including files . that uses the params property inside the postData when the mimeType is application/x-www-form-urlencoded all the param All the params are passed as a simple url params in the body param1=value1& param2=value2 when the mimeType is multipart/form-data the name value pair are being converted to a FormData object that also can contains files. I added a custom nunjuck filter called file. it's just convert the file to his actual path , and prefix it with the string sendFile: this is passed to the postData as a file steam .