title: HTTP 400 Bad Request Error C#
body: <p>I'm encountering this error: HTTP 400 Bad Request, what could possibly be the error? How will I check if the API is correct with its parameters?</p>
  
  <p>I tried the solutions suggested online but still no luck. 
  Could anyone suggest on how to resolve this issue?</p>
  
  <pre><code>            string url = "/api/customers/reconnect/"; //sample url
              string parameters = new JavaScriptSerializer().Serialize(new { 
                  accountNumber = info.accountNumber,
                  serviceNumber = info.serviceNumber,
                  lastName = info.lastName,
                  processType = info.processType,
                  reconnectReason = info.reconnectReason,
                  priName = info.priName,
                  requestDate = info.requestDate,
                  Amount = info.amount,
                  Email = info.email,
                  priName2 = info.priName2,
                  withReconnectFee = info.withreconnectFee,
                  contactNo2 = info.contactNo2,
                  stmtFaxNo = info.stmtFaxNo
              });
  
              HttpVerb method = HttpVerb.POST;
  
              var request = (HttpWebRequest)WebRequest.Create(url);
              request.Method = method.ToString();
              request.ContentLength = 0;
              request.ContentType = ContentType;
              request.Accept = "application/json";
  
  
              var encoding = new UTF8Encoding();
              var bytes = encoding.GetBytes(parameters); //Encoding.GetEncoding("iso-8859-1").GetBytes(parameters);
              request.ContentLength = bytes.Length;
              using (var writeStream = request.GetRequestStream())
              {
                  writeStream.Write(bytes, 0, bytes.Length);
                  writeStream.Close();
              }              
  
              using (var response = (HttpWebResponse)request.GetResponse())
              {
                  var responseValue = string.Empty;
  
                  using (var responseStream = response.GetResponseStream())
                  { 
                      if(responseStream != null)
                          using (var reader = new StreamReader(responseStream))
                          {
                              responseValue = reader.ReadToEnd();
                          }
                  }
  
                  if (response.StatusCode == HttpStatusCode.OK)
                  {
                      var jsonVal = JObject.Parse(responseValue);
                      result = (string)jsonVal["result"].ToString();
                  } 
  </code></pre>