I am using WebClient with C# the following code works fine
wc = new WebClient();
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
NameValueCollection nvc = new NameValueCollection();
nvc.Add("webdata", JsonConvert.SerializeObject(webdata));
response = wc.UploadValues(@"http://localhost/api/results", "PUT", nvc);
The application is most likely to be used over a mobile data connection, so to minimize costs, i would like to make sure the data is compressed, as it is all txt. I have used json instead of xml to reduce the size (and could possibly alter the format to reduce overhead further)
Do i need to compress the data it manually prior to adding it to the WebClient or is there some way i can tell WebClient that my webserver can handle compression (or does compression on the webserver only work for downloads?)
i am running apache/php on the webserver
thanks in advance