目前接到一个新需求是在电脑关机时调用一个接口,问了问同事+度娘给整出来了,下面为代码:

POST请求:

Invoke-WebRequest -UseBasicParsing http://xxxxxxxxxxx/xxxApi/IAsr/Filter -ContentType "application/json" -Method POST -Body "{'cmd':'unregister','cctuserid':$env:username}"

$env:username 为电脑账户

以下为调用结果

 

电脑cmd、powerShell调用HTTP post 接口

 

 

 

GET请求:

Invoke-WebRequest http://xxxxx:8085/xxxxxx/app/logout/$env:username 

结果:

电脑cmd、powerShell调用HTTP post 接口

 

相关文章:

  • 2021-11-29
  • 2021-12-26
  • 2021-11-11
  • 2021-12-26
  • 2021-12-26
  • 2021-10-20
  • 2018-10-23
  • 2021-04-28
猜你喜欢
  • 2021-11-11
  • 2021-11-11
  • 2021-10-20
  • 2021-10-30
  • 2021-10-30
  • 2021-10-20
  • 2021-11-21
  • 2021-10-19
相关资源
相似解决方案