I want to post the RESTful service from the name of the url is
"https://api.pipedrive.com/v1/persons?api_token=tS5adsXC6V2nH991"
list of complete API is present in "https://developers.pipedrive.com/v1"
Following is my 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();
I am getting the error
The remote server returned an error: (400) Bad Request.
please help