You can't make a POST request. RRS feed

  • Question

  • Here is the same as the query in PHP:

    $result = $request->setPOSTdata(array( 'xml' => $xml, 'sign' => md5($xml . $secret_key), ))->POST($API_URL);

    Don't know how to build the same thing in C #, finding information in the documentation do not give answers to the solution to such a request. 
    Based on the fact that I write Windows CE 5.0 where Net Framework 2.0-3.5
    Now I have code like:

    var xml = @"<?xml version='1.0' encoding='utf=8'?>
            <request module='subdivision' format='json'>
            <filter id='' db='' state=''>
            <auth id='site'>

            Dictionary<string, object> postParameters = new Dictionary<string, object>();
            postParameters.Add("xml", xml);
            postParameters.Add("sign", ??? );
            string postURL = "https://....";
            HttpWebResponse webResponse = Upload.MultipartFormDataPost(postURL, postParameters);
            StreamReader responseReader = new StreamReader(webResponse.GetResponseStream());
            string fullResponse = responseReader.ReadToEnd();

    Friday, January 6, 2017 4:28 AM

All replies