views:

358

answers:

1

I have a webmethod like this:

    [WebMethod]
    public string HelloWorld(string a)
    {
        return a;
    }

The instructions to post to my asmx webmethod say to post like this:

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

a=string

However I want to be able to accept this:

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

string

How can I do that? Thanks

+1  A: 

This is more an issue of the HTTP POST protocol moreso than an ASP.NET issue. The format of the POST body must be "variable=value;variable2=value2..."

jagprinderdeep