卷曲“无法解析主机:POST";ASP.NET Web服务 [英] Curl "Could not resolve host: POST" ASP.NET Web service

查看:43
本文介绍了卷曲“无法解析主机:POST";ASP.NET Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2008创建了一个简单的ASP.NET Web服务.当我通过IE 8使用该Web服务时,它可以正常工作,但是我无法使用curl来使用它.

I created a simple ASP.NET Web service using Visual studio 2008. The Web service works fine when I use it via IE 8, but I didn't manage to consume it using curl.

基本上,Web服务的欢迎页面"指示POST请求的以下示例:

Basically the "welcome page" of the Web service indicates the following example for a POST request:

请求格式:

POST /Service1.asmx/TestService HTTP/1.1
Host: IP_ADDRESS
Content-Type: application/x-www-form-urlencoded
Content-Length: length

响应示例:

HTTP/1.1 200 OK

这是我使用以下curl命令尝试执行的操作:

This is what I'm trying to do using the following curl command:

curl POST http://IP_ADDRESS/Service1.asmx/TestService  -d ""

但是我收到以下错误消息:

But I get the following error message:

curl: (6) Could not resolve host: POST

推荐答案

尝试这样;

curl -X POST http://IP_ADDRESS/Service1.asmx/TestService  -d ""

这篇关于卷曲“无法解析主机:POST";ASP.NET Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆