我尝试使用powershell
中的Invoke-RestMethod上传图片当我尝试从远程服务器POST到PHP时,我没有收到PHP的任何答案。
这是来自powershell的代码:
> function uploadAPI($uri, $file, $api)
> {
> $result = Invoke-RestMethod -Uri $uri -Method Post -InFile $file -ContentType "multipart/form-data"
> Write-Output $result
> Break Script
>
> }
>
> uploadAPI "http://192.168.1.59:8888/api/" "C:\source\italian-landscape-mountains-nature.jpg" "w"
这是PHP的代码
> print_r([$_FILES, $_POST, $_REQUEST]);
>
> die;
回复为空:
> Array (
> [0] => Array
> (
> )
>
> [1] => Array
> (
> )
>
> [2] => Array
> (
> )
>
> )