0

I have a simple Restful C# webservice contaning, with this post function:

public void Post(HttpRequestMessage value) 
    {
        if (value == null) Debug.WriteLine("Post *** Request. We got null");
        Debug.WriteLine("Post Request. We got: " + value);
       
    }

I'm testing it using a simple HTML page containing this code

<form action="http://localhost:44378/api/values" method="post">
      <input type="text" name="data" value="mydata" />
      <input type="submit" />
</form>

The Web service recieves the Post request, however it doesn't seem to get the data I send it. I get always null.

Any clues what's going wrong and what I should change?

Thanks alot.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.