0

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!

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.