小编Mur*_*e85的帖子

Git RPC 失败;curl 18 传输关闭,剩余读取数据未完成

任何超过特定大小的 repo 的 git clone 都会在中途失败,我可以使用 ssh 方法,但是在这种情况下需要 http,因为它是 brew install 的一个辅助操作。

$ brew cask install homebrew/cask-versions/adoptopenjdk8

==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 422119, done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask` exited with 128.
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/utils.rb:266:in `safe_system'
/usr/local/Homebrew/Library/Homebrew/tap.rb:273:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:157:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:123:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:103:in …
Run Code Online (Sandbox Code Playgroud)

git homebrew-cask

7
推荐指数
4
解决办法
1万
查看次数

Powershell使用NTLM调用WebRequest进行发布

初始问题

如何使用Powershell进行Invoke-WebRequest或类似操作,以便使用NTLM身份验证,但还要为帖子提供正文。

以下代码示例是我的示例示例,其中使用了invoke Web请求并将响应通过管道传递到.json文件。用户名和密码变量未包括在示例中。

$myURL = https://example.blah.etc
$params = @" {""EXAMPLE1":"STUFF"} "@ 

$Headers = @{ Authorization = "Basic {0}" -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $Username,$Password))) }


Invoke-WebRequest -Uri $myURL  -Headers $Headers -Method POST -ContentType "application/json" -Body  $params  | Select-Object -ExpandProperty Content > "C:\output.json"
Run Code Online (Sandbox Code Playgroud)

更新

使用-UseDefaultCredentials仅适用于Gets,不适用于帖子。



错误响应

远程服务器返回错误:(401)未经授权

rest powershell ntlm

5
推荐指数
1
解决办法
3905
查看次数

标签 统计

git ×1

homebrew-cask ×1

ntlm ×1

powershell ×1

rest ×1