Add _method and use always post with multipart/form-data

This commit is contained in:
Petri Asikainen 2021-07-14 13:01:56 +03:00
parent 794589622a
commit ae68666bbd

View file

@ -66,6 +66,10 @@
if($null -ne $body -and $Body.Keys -contains 'image' ){
if($PSVersionTable.PSVersion -ge '7.0'){
$Body['image'] = get-item $body['image']
# As multipart/form-data is always POST we need add
# requested method for laravel named as '_method'
$Body['_method'] = $Method
$splatParameters["Method"] = 'POST'
$splatParameters["Form"] = $Body
} else {
# use base64 encoded images for powershell version < 7