I am struggling sending data from my rest client to my rest server...
I have created a rest server sending xml to the client, and that works well. However, sending data from the client to the server, I am having a hard time.
Client:
_httpClientRead = new HttpClient("http://127.0.0.1:8000/");
var form = new HttpUrlEncodedForm();
form.Add("startDate", startDate);
_httpClientRead.Post("test", form.CreateHttpContent())
Server:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "test")]
Meeting CreateNewMeeting(string startDate);
The problem seems to be the HttpUrlEncodedForm on the client side. If I am sending an empty HttpUrlEncodedForm object in the post request, the server receives the request. When adding the the HttpUrlEncodedForm attributes, the server never receives the request, and there are no error messages!
What am I missing here? ( the server is returning xml )
How should the post data be sent to the server?
Thanks