Doing multipart requests with PowerShell is quite complicated and requires several extra steps for large file uploads. An easy example for a small file can be found on StackOverflow. An in depth discussion can be found in this blog post.
It would be a huge improvement if the WebRequestPSCmdlets (Invoke-RestMethod and Invoke-WebRequest) could be enhanced so that they support Multipart messages directly.
For an implementation I would expect the following parameters:
- MultipartFile (Path)
- MultipartName (Name to be used in Multipart message)
.NET Core seems to have support for MultipartContent which may simplify the implementation.
Doing multipart requests with PowerShell is quite complicated and requires several extra steps for large file uploads. An easy example for a small file can be found on StackOverflow. An in depth discussion can be found in this blog post.
It would be a huge improvement if the WebRequestPSCmdlets (Invoke-RestMethod and Invoke-WebRequest) could be enhanced so that they support Multipart messages directly.
For an implementation I would expect the following parameters:
.NET Core seems to have support for MultipartContent which may simplify the implementation.