title: calling the rest api post from mvc
body: <p>I want to post the RESTful service from  the name of the url is 
  "<a href="https://api.pipedrive.com/v1/persons?api_token=tS5adsXC6V2nH991" rel="nofollow">https://api.pipedrive.com/v1/persons?api_token=tS5adsXC6V2nH991</a>"<br>
  list of complete API is present in "<a href="https://developers.pipedrive.com/v1" rel="nofollow">https://developers.pipedrive.com/v1</a>"</p>
  
  <p>Following is my code</p>
  
  <pre><code>  string URL = "https://api.pipedrive.com/v1/persons?api_token=tS5adsXC6V2nH991";
              string DATA = @"{""object"":{""name"":""rohit sukhla""}}";
         var dataToSend = Encoding.UTF8.GetBytes(DATA);
                  //Passyour service url to the create method
                  var req =
                  HttpWebRequest.Create(URL);
                  req.ContentType = "application/json";
                  req.ContentLength = dataToSend.Length;
                  req.Method = "POST";
                 req.GetRequestStream().Write(dataToSend, 0, dataToSend.Length);
                  var response1 = req.GetResponse();
  </code></pre>
  
  <p>I am getting the error </p>
  
  <blockquote>
    <p>The remote server returned an error: (400) Bad Request.</p>
  </blockquote>
  
  <p>please help</p>