How to send excel file on Invoke-Restmethod.

I am trying to upload an excel file, while trying the same from postman it is working fine but while trying it from power shell it is not working.

Here are the below details I am using on postman
Methode : POST
URL : https://localhost/api/v1/boarding/validate
In the header section
authorization: 09368290_0d9227327d291d8a
body section "
Type : form-data:
filename: “C:\Users\Desktop\Template.xlsx”
Content-Type :application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition : form-data

any thoughts on this ?

Can you post the PowerShell code you are trying to use?

$validationBody = (
‘Content-Disposition: form-data’,‘name = file’,`
‘filename=C:\Users\Template.xlsx’,`
‘Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’
)
Invoke-RestMethod -Method Post `
-Uri $ValidatorAPI `
-Headers @{“Authorization” = $ResNew ; “accept” = “application/json”} `
-ContentType “multipart/form-data” `
-Body $validationBody

While sending the same thing on postman it is working fine