简体   繁体   English

Curl 命令在 centos 服务器上不起作用

[英]Curl command not working from centos Server

I try to execute the following curl command from centos to Redhat server.我尝试从centos到Redhat服务器执行以下curl命令。 It returns the following error.它返回以下错误。 But the same curl command working fine, when I'm directly executing it in RedHat server.但是当我直接在 RedHat 服务器中执行它时,相同的 curl 命令工作正常。

Curl Command:卷曲命令:

curl --cert client_cert.pem --key client_key.pem --cacert server_cert.pem -u uname:pwd -X POST https:xyz.com/start -H "Content-Type: application/json" -H "Accept: / " --data '{"operationName": "Upload", "operationAlias": "Upload configuration data from the network", "operationAttributes": {"takeSranBtsFileBackups": true, "WS": "working_set2_32118"}}' -k curl --cert client_cert.pem --key client_key.pem --cacert server_cert.pem -u uname:pwd -X POST https:xyz.com/start -H "Content-Type: application/json" -H "接受: / " --data '{"operationName": "Upload", "operationAlias": "从网络上传配置数据", "operationAttributes": {"takeSranBtsFileBackups": true, "WS": "working_set2_32118"}}' -克

Error:错误:

"error": {"userMessage":"WebApplicationException: com.sun.jersey.api.MessageException: A message body reader for Java class com.nokia.oss.configurator.rac.operationservice.webservice.rest.bindings.StartOperation, and Java type class com.nokia.oss.configurator.rac.operationservice.webservice.rest.bindings.StartOperation, and MIME media type application/octet-stream was not found. } curl: (6) Could not resolve host: application; Name or service not known} “错误”:{“userMessage”:“WebApplicationException:com.sun.jersey.api.MessageException:Java 类 com.nokia.oss.configurator.rac.operationservice.webservice.rest.bindings.StartOperation 的消息正文阅读器,以及Java 类型类 com.nokia.oss.configurator.rac.operationservice.webservice.rest.bindings.StartOperation,并且未找到 MIME 媒体类型 application/octet-stream。} curl: (6) 无法解析主机:应用程序;名称或服务未知}

How can I resolve this error?我该如何解决这个错误?

curl: (6) Could not resolve host: application; Name or service not known}

Looks like dns can't resolv https:xyz.com Ok,your host is wrong format.貌似dns无法解析https:xyz.com 好吧,你的主机格式不对。 Use this format: https://stackoverflow.com使用此格式: https : //stackoverflow.com

or check your dns config in centos:或在 centos 中检查您的 dns 配置:

[root@pftest2 ~]# cat /etc/resolv.conf 
# Generated by NetworkManager
nameserver 114.114.114.114
nameserver 8.8.8.8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM