Upload Binary data as HTTP POST

Below is the ASP.NET C# implementation of Uploading binary data like images as POST request to target URL: private bool UploadFile(string PostURL) { try { int contentLength = fileUpload.PostedFile.ContentLength; byte[] data = new byte[contentLength]; fileUpload.PostedFile.InputStream.Read(data, 0, contentLength); // Prepare web request… HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(PostURL); webRequest.Method = "POST"; webRequest.ContentType = "multipart/form-data"; webRequest.ContentLength = data.Length; using …