Adding media_id parameter to /statuses/update.json endpoint POST request


Can someone give me an example of framing the POST request to /statuses/update.json endpoint which includes media_id parameter??

Currently I have the request as below:

               // CODE STARTING POINT

                    WebClient m_twitWebClient = new WebClient();
                    string boundary = Guid.NewGuid().ToString();
                    string header = string.Format("--{0}", boundary);
                    string footer = string.Format("--{0}--", boundary);
                    string message_to_post = "Posted from Windows application"
                    StringBuilder contents = new StringBuilder();
                    contents.AppendLine(String.Format("Content-Disposition: form-data; name=\"{0}\"", "status"));


                    string fileHeader = String.Format("Content-Disposition: file; name=\"{0}\"; filename=\"{1}\"", "media[]", "MyFileName");
                    byte[] image = File.ReadAllBytes("image file full path");                        
                    string fileData = queryEncoder.GetString(image);
                    contents.AppendLine(String.Format("Content-Type: {0}", "image/jpeg"));
                    contents.AppendLine(String.Format("Content-Transfer-Encoding: binary"));

                    byte[] bytes1 = Encoding.UTF8.GetBytes(contents.ToString());
                    contents = new StringBuilder();


                    byte[] bytes2 = Encoding.GetEncoding(contentEncoding).GetBytes(contents.ToString());

                    byte[] bytes = new byte[bytes1.Length + bytes2.Length];
                    System.Buffer.BlockCopy(bytes1, 0, bytes, 0, bytes1.Length);
                    System.Buffer.BlockCopy(bytes2, 0, bytes, bytes1.Length, bytes2.Length);

                        m_twitWebClient.UploadDataAsync(new Uri(""), bytes);

             //CODE ENDING POINT

This works fine for uploading the status, but I need to update the media as well by including the media id. I have obtained media_id by sending the request to /media/upload endpoint. But not sure how to include it in this end point.

Can someone suggest me how it can be done.


I got to solve this by using Spring.Social.Twitter libraries

These libraries are very useful and designed in very user friendly manner