Am getting the below error , can anyone give the solution
The remote server returned an error: (400) Bad Request.
httpWebRequest.ContentType = "application/json;charset=UTF-8";
httpWebRequest.Accept = "*/*";
httpWebRequest.Method = "POST";
httpWebRequest.Headers.Add("authtoken", "cb327707a0e8539254fcd3a58d896b43");
httpWebRequest.Headers.Add("organization_id", "673578474");
var vJsonData = "{\"contact_id\": 1523420000000070013,\"salutation\": \"Mr\",\"first_name\": \"Jams\",\"last_name\": \"jarald\",\"email\": \"
jamsjarald@mobiusservies.in\",\"phone\": \"+044-123654\",\"mobile\": \"+91-9842326244\",\"skype\": \"skypePIM\",\"designation\": \"TESTING\",\"department\": \"TESTING Team\",\"enable_portal\": true }";
var json = vJsonData.ToString();
//json = "{" + json + "}";
json = json.Replace(@"\", "");
using (var writer123 = new System.IO.StreamWriter(httpWebRequest.GetRequestStream()))
{
writer123.Write(json);
writer123.Flush();
writer123.Close();
}
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
var response123 = new HttpResponseMessage(HttpStatusCode.OK);
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var objText = streamReader.ReadToEnd();
var objJson = (Newtonsoft.Json.Linq.JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(objText);
response123.Content = new StringContent(objText);
}