1. 问题描述:

1.公司内部服务器需要通过http接口方式访问另一公司内部接口服务器。

2.申请信息安全开通访问权限,但是只能开通到服务器+端口号,例如:192.168.1:8080,无ping权限,对方公司开通路由后,让测试是否可行了,公司内部服务器无外网,又无telnet、wge,安装有点麻烦,对方着急等回复。

2. 解决:

通过curl进行http接口服务测试,与对方交互方式是:http+json(示例把ip和参数替换了下)

curl -l -H "Content-type: application/json" -X POST -d '{"appCode": "aaa","appSecret": "fdfaadsfdsfdsfd"}'  http://10.55.1.412:8081/web/test.do

crul其他几种方式:

1.测试http+get请求

curl -l "http://10.55.1.412:8081/web/test.do" 

2.测试http+post请求

curl -d "appCode=aaa&appSecret=fdfaadsfdsfdsfd" "http://10.55.1.412:8081/web/test.do"

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-11-13
  • 2022-01-01
猜你喜欢
  • 2021-11-28
  • 2022-03-08
  • 2021-11-20
  • 2022-02-13
  • 2021-12-24
  • 2022-12-23
相关资源
相似解决方案