How would I use Invoke-WebRequest
to post all these parameters
POST /token HTTP/1.1
Host: login.huddle.net
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&client_id=s6BhdRkqt&redirect_uri=MyAppServer.com/receiveAuthCode&code=i1WsRn1uB
Here's how to convert that body into one which PowerShell can interpret.
$body = @{grant_type='authorization_code'
client_id='s6BhdRkqt'
redirect_uri='MyAppServer.com/receiveAuthCode'
code='i1WsRn1uB'}
$contentType = 'application/x-www-form-urlencoded'
Invoke-WebRequest -Method POST -Uri yourUrl -body $body -ContentType $contentType
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With