首页 文章

卷曲http发布请求

提问于
浏览
0

我正在尝试根据网站的文档发送帖子请求,如下所示:POST /WindchillQualitySolutions11.0/DataEngine.asmx/GetSessionToken HTTP / 1.1主机:vm-test内容类型:application / x-www-form-urlencoded内容-Length:长度

用户名=比尔和密码= passwd文件&组名=经理&SecondsValid = 0

内部网站地址如下:http://itdabcSomeNumber/ptcwindchillqualitysolutions11.0/

我试过的curl命令:

curl -H 'Host:itdabcSomeNumber' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Content-Length: length' -d 'UserName=myUserName&Password=MyPassWord&GroupName=Manager&SecondsValid=0' http://itdabcSomeNumber/WindchillQualitySolutions11.0/DataEngine.asmx/GetUserGroup

我收到以下错误:curl:(6)无法解析主机:应用程序卷曲:(6)无法解析主机:长度''密码'无法识别为内部或外部命令,可运行程序或批处理文件 . “GroupName”不被识别为内部或外部命令,可操作程序或批处理文件 . 'SecondsValid'不被识别为内部或外部命令,可操作程序或批处理文件 .

我也试过-H用户名和密码,它也不起作用 . 谁能告诉我发送请求的正确命令 .

1 回答

  • 0

    尝试

    curl -X POST \
      http://server_or_ip/WindchillQualitySolutions11.0/DataEngine.asmx/GetSessionToken \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -d 'UserName=Bill&Password=passwd&GroupName=Manager&SecondsValid=0'
    

相关问题