Пример #1
0
        private WebRequest GetRequest(string file)
        {
            var httpRequest = WebRequest.Create(espUrl);
            var builder     = new MultiPart();

            builder.AddField("AutoResize", "true");
            builder.AddFileField("UploadFile", file);
            httpRequest.ContentType = "multipart/form-data; boundary=" + builder.Boundary;
            httpRequest.Method      = "POST";
            using (var stream = httpRequest.GetRequestStream())
            {
                builder.GetStream().CopyTo(stream);
            }
            return(httpRequest);
        }
Пример #2
0
 private WebRequest GetRequest(string file)
 {
     var httpRequest = WebRequest.Create(espUrl);
      var builder = new MultiPart();
      builder.AddField("AutoResize", "true");
      builder.AddFileField("UploadFile", file);
      httpRequest.ContentType = "multipart/form-data; boundary=" + builder.Boundary;
      httpRequest.Method = "POST";
      using (var stream = httpRequest.GetRequestStream())
      {
     builder.GetStream().CopyTo(stream);
      }
      return httpRequest;
 }