我使用Visual Studio 2008创建了一个简单的ASP.NET Web服务。当我通过IE 8使用它时,Web服务工作正常,但我没有设法使用curl来使用它。
基本上是#34;欢迎页面" Web服务的示例表示POST请求的以下示例:
请求格式:
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命令执行的操作:
curl POST http://IP_ADDRESS/Service1.asmx/TestService -d ""
但是我收到以下错误消息:
curl: (6) Could not resolve host: POST
答案 0 :(得分:0)
试试这个;
curl -X POST http://IP_ADDRESS/Service1.asmx/TestService -d ""