title: c# System.Net.WebException: 'Error on the remote server: (400) Bad Request.' - HttpWebResponse
body: <pre><code>        var url = ConfigurationManager.AppSettings["URL"] + "/Archivador/MoverEnvio";
  
          HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
  
          if (Certificado != null)
          {
              // Y añadirlo a la petición HTTP
              req.ClientCertificates.Add(Certificado);
          }
  
          req.Method = "PUT";
          req.ContentType = "application/json";
  
          ArchivadorModelPut Mover = new ArchivadorModelPut()
          {
              ID_ARCHIVADOR = idArchivador,
              ID_ENVIO = idEnvio
  
          };
          using (var streamWriter = new StreamWriter(req.GetRequestStream()))
          {
              string json = JsonConvert.SerializeObject(Mover);
  
              streamWriter.Write(json);
              streamWriter.Flush();
              streamWriter.Close();
          }
          using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
          {
              StreamReader reader = new StreamReader(resp.GetResponseStream());
              var dato = reader.ReadToEnd();
              string returnString = resp.StatusCode.ToString();
          }
  </code></pre>
  
  <p>I got this Exception:</p>
  
  <blockquote>
    <p>System.Net.WebException: 'Error on the remote server: (400) Bad
    Request.'</p>
  </blockquote>
  
  <p>On line:</p>
  
  <pre><code>using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
  </code></pre>
  
  <p>I don't know how to resolve the problem, can someone help me?
  If you need more information about it, let me know.</p>