Open Surowa opened 7 months ago
I hope to review this within the next week.
I'm wondering if these changes belong in Invoke-RequestRouter.ps1?
Could be, is that the best place for handling this type of request post-processing?
Yeah, I think so that file is where all important things kinda happen now.
This adds a way to upload files. The way I currently designed it, is by having an additional entry in the json config file that allows a file destination path set server-side. Having it set client-side with parameters would be a security issue, imo. After the file has been uploaded to the server, the normal scripts that get invoked can be used to actually do something else with the file, such as adding it to some external database, or moving it elsewhere. Let me know if you like the current design, or if you prefer something else.
Example client request: $uri = 'http://localhost:8081/files' $filePath = 'c:/temp/testfile.json' $upload= Invoke-RestMethod -Uri $uri -Method Post -InFile $filePath -ContentType 'multipart/form-data'