Powershell send request for XML POST

Powershell send request for XML POST

on Powershell

add line for you need request web address

$Uri = "request web address"

add line for for you need request XML body

$body = "xml form for request"

add line for create servce

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

add line to set web request

$build_info = Invoke-WebRequest -uri $Uri -Method POST -Body $body -ContentType 'application/XML' #-Credential $usercreds

Full code :

$Uri = "request web address"
$body = "xml form for request"

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$build_info = Invoke-WebRequest -uri $Uri -Method POST -Body $body -ContentType 'application/XML' #-Credential $usercreds
$build_info.Content

留言

這個網誌中的熱門文章

Easy Triangle Calculator

Swift Sprite Kit easy to create bullet

Powershell transfert UPS Worldship address book to csv file for UPS web import