I'm trying to pass an image in power shell replicating this cURL request
curl -u user:apikey -F ‘data=@1234.jpg’
https://denton.gradesfirst.com/api/users/pictures
I authenticate fine but don't know to replicate ‘data=@1234.jpg’
in powershell so the other system will know where the picture is.
$username = "username"
$password = "apikey"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
Invoke-RestMethod -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -uri "https://test.test.test.com/api/users/pictures" -Method Put -InFile "C:\Users\username\Downloads\pic-2017\210569.jpg" -ContentType 'image/jpg'