First of all, I wrote a simple php page, that picks up some variables from the POST parameters such as a query and a authentication string, and returns the result as xml. I intend to call this page with the WebClient class from a Silverlight application. I'm using POST because we are querying the database with any valid sql statement, not only select statements. The WebClient class uses the UploadDataAsync method to post to a http server, however it requires the post parameters be passed as a NameValueCollection. This class is missing in the Silverlight runtime. How do I proceed???
+1
A:
Use the WebRequest API instead of the WebClient API.
var request = WebRequest.Create(requestUriString);
request.Method = "POST";
request.BeginGetRequestStream()
Michael S. Scherotter
2010-03-31 21:20:20
This is so much more complicated than WebClient (http://msdn.microsoft.com/en-us/library/system.net.webrequest.begingetresponse(VS.71).aspx).
cmaduro
2010-04-02 04:09:02
Actually I meant the headers. I know hot to set the method, but how do I set the headers?
cmaduro
2010-04-05 21:47:19