我正在尋找在PowerShell中的方法,以基本字符串張貼到PHP腳本,看起來像這樣:POST字符串PHP腳本中使用PowerShell
<?php
$file = date("Y-m-d_H-i-s") . ".creds";
file_put_contents($file, file_get_contents("php://input"));
?>
我希望你能幫助我,謝謝!
我正在尋找在PowerShell中的方法,以基本字符串張貼到PHP腳本,看起來像這樣:POST字符串PHP腳本中使用PowerShell
<?php
$file = date("Y-m-d_H-i-s") . ".creds";
file_put_contents($file, file_get_contents("php://input"));
?>
我希望你能幫助我,謝謝!
我希望你能通過鏈接。它會幫助你更好地理解。它有所有必需的例子。
可以使用Invoke-WebRequest cmdlet的PowerShell中3.0及以上,使你的web/PHP服務的請求。
Invoke-WebRequest cmdlet有許多參數可用於自定義請求,例如-Headers(用於設置標題),-Body用於設置正文內容以及-ContentType用於設置請求的內容類型。
您很可能想要使用cmdlet的-Body參數發送簡單的字符串。
按照上面的鏈接瞭解詳細信息和一些示例。
[http請求與powershell]可能重複(http://stackoverflow.com/questions/7715695/http-requests-with-powershell) –