使用telnet传递json内容

时间:2018-03-02 16:29:43

标签: json http curl telnet

我试图使用telnet传递json,这是我的用例:

mohamadm-mac:~ mohamadm$ telnet 192.168.56.5 8081
Trying 192.168.56.5...
Connected to ip-192-168-56-5.eu-west-1.compute.internal.
Escape character is '^]'.
PUT http://192.168.56.5:8081/artifactory/api/repositories/test-local HTTP/1.0
Content-Type: application/json
{"rclass" : "local"}

HTTP/1.1 500 Internal Server Error
Server: Artifactory/5.8.4
X-Artifactory-Id: 84c66c5bb11d016e:-6e6f432f:161a8395cb7:-8000
Content-Type: application/json
Date: Fri, 02 Mar 2018 16:25:40 GMT
Connection: close

{
  "errors" : [ {
    "status" : 500,
    "message" : "No content to map to Object due to end of input"
  } ]
}Connection closed by foreign host.

我该如何解决这个问题?我需要像以下curl一样使用telnet:

curl -XPUT http://192.168.56.5:8081/artifactory/api/repositories/test-local -H "Content-Type: application/json" -d '{"rclass" : "local"}' -uadmin:password

提前感谢您的帮助。

0 个答案:

没有答案