I am trying to use an invoke-webrequest or invoke-RestMethod for a curl command but can't quite get it right. The curl command that functions is:
curl.exe -X GET -H "Content-Type: application/json" --user 'blahblah:blahblah' https://ourdomain.learnupon.com/api/v1/users
I have attempted:
$headers = @{ '--user' = 'blahblah:blahblah' } Invoke-RestMethod -Method Post -Uri 'https://ourdomain.learnupon.com/api/v1/users' -ContentType "application/json" -Headers $headers
and also:
$post_values = @{'--user'='blahblah:blahblah'} Invoke-WebRequest -Uri https://ourdomain.learnupon.com/api/v1/users -Method POST -Body $post_value
Any help would be super appreciated!