it would be great if command
Code: Select all
/tool/fetch http-method=post url="https://blabla.server/fileservice" mode=https
Better without that annoying 4kB limitation!
May I believe in that it will be implemented?
/tool/fetch http-method=post url="https://blabla.server/fileservice" mode=https
:set $data "up to 63KB..."
/tool fetch http-method=post http-content-type="application/json" http-data=$data url="https://testserver.lv/index.php"
Thank youA few months ago no one knew that chunking was possible in combination with variable in ROS and now it used widely.
:global $data "test";
:global $url "https://prod-51.westeurope.logic.azure.com:443/workflows/blabla/triggers/manual/paths/invoke....";
/tool fetch mode=https http-method=put http-data=$data url=$url
{
"headers": {
"User-Agent": "Mikrotik/7.x,Fetch",
"Content-Type": "application/x-www-form-urlencoded"
},
"body": {
"$content-type": "application/x-www-form-urlencoded",
"$content": "dGVzdA==",
"$formdata": [
{
"key": "test",
"value": ""
}
]
}
}
/export file=export.rsc
:global data [/file get [/file find name=export.rsc] contents];
this is example for "file download" and using chunks.It is the first code example in this tread: viewtopic.php?f=9&t=177530
/tool/fetch
Please, lets focus here on how to anyhow send any file from mikrotik to remote HTTP server. (not vice versa, etc.)
:global filedata [/file get myfile contents]
:put $filedata
Look I ain't arguing you ROS shouldn't support some "file upload". All I was saying "file upload" can happen in a variety of ways (form-data, WebDAV, etc.) – so it's not as simple as a missing "files=" min fetch.@Amm0
https://help.mikrotik.com/docs/display/ ... -Variables
> Note: Variable value size is limited to 4096bytes
https://help.mikrotik.com/docs/display/ROS/Fetch
/export file=export.rsc
:global data [/file get [/file find name=export.rsc] contents];
:global $url "https://prod-51.westeurope.logic.azure. ... ths/invoke....";
/tool fetch mode=https http-method=put http-data=$data url=$url
Dear Mikrotik forums,
it would be great if commandcan specify the file on mikrotik that will be send as data of POST request.Code: Select all/tool/fetch http-method=post url="https://blabla.server/fileservice" mode=https
Better without that annoying 4kB limitation!
May I believe in that it will be implemented?
+1 for this featureDear Mikrotik forums,
it would be great if commandcan specify the file on mikrotik that will be send as data of POST request.Code: Select all/tool/fetch http-method=post url="https://blabla.server/fileservice" mode=https
Better without that annoying 4kB limitation!
May I believe in that it will be implemented?
+1 for this featureDear Mikrotik forums,
it would be great if commandcan specify the file on mikrotik that will be send as data of POST request.Code: Select all/tool/fetch http-method=post url="https://blabla.server/fileservice" mode=https
Better without that annoying 4kB limitation!
May I believe in that it will be implemented?