title: JIRA API create Issue is giving bad request error
body: <p>I am trying to create an issue in JIRA using API. 
  If I am using postman in chrome then it is working fine. But if I am trying to do it using .net code it is giving me error. </p>
  
  <p>error returned is "400 Bad Request".</p>
  
  <p>I have done extensive search related to this on StackOverflow and Web but either I can't find a solution or the solutions given are not helping me.</p>
  
  <p>This my piece of code:</p>
  
  <pre><code>        string data = @"{ ""fields"":{""project"":{""key"":""TES""},""summary"":""sum1"",""issuetype"":{""name"":""Bug""},""duedate"":""2013-01-24 09:00 AM +05:30"",""customfield_10000"":[{""value"":""None - Nothing""}],""reporter"":{""name"":""praveen_tadikemalla""}}}";
  
  
         //tried  by using new class Issue also
         /* Issue data = new Issue();
          data.fields = new Fields();
          data.fields.description = "test";
          data.fields.summary = "test bugs";
  
          data.fields.issuetype = new IssueType();
          data.fields.issuetype.name = "bug";
  
          data.fields.project = new Project();
          data.fields.project.key = "TES";         
         */
  
          string postUrl = "http://localhost:8080/rest/auth/latest/session";
  
          System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
          client.BaseAddress = new System.Uri(postUrl);
  
  
          byte[] cred = UTF8Encoding.UTF8.GetBytes("amit:GoMessiGo");
  
          client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(cred));
          client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  
          System.Net.Http.Formatting.MediaTypeFormatter jsonFormatter = new System.Net.Http.Formatting.JsonMediaTypeFormatter();  
          System.Net.Http.HttpContent content = new System.Net.Http.ObjectContent&lt;string&gt;(data,jsonFormatter);
  
         //in case if i use custom Issue class   
         // System.Net.Http.HttpContent content = new System.Net.Http.ObjectContent&lt;Issue&gt;(data,jsonFormatter);
  
  
          System.Net.Http.HttpResponseMessage response = client.PostAsync("http://localhost:8080/rest/api/latest/issue/", content).Result;     
  
          string result=null;
  
          if (response.IsSuccessStatusCode)          
          {
              result = response.Content.ReadAsStringAsync().Result;
          }
          else
          {
             result  = response.StatusCode.ToString();
          }
        return result;
  </code></pre>
  
  <p>I have sent authorization in header.</p>
  
  <p>I am able to hit API for get request.</p>
  
  <p>What I doubt is that there is some problem while sending post request to server using this method.(client.PostAsync)   </p>
  
  <pre><code>   System.Net.Http.HttpResponseMessage response = client.PostAsync("http://localhost:8080/rest/api/latest/issue/", content).Result;    
  </code></pre>
  
  <p>Or</p>
  
  <p>this Code snippet</p>
  
  <pre><code>    System.Net.Http.HttpContent content = new System.Net.Http.ObjectContent&lt;Sting&gt;(data,jsonFormatter); 
  </code></pre>
  
  <p>but these are my assumptions</p>