title: Pass javascript object with http post
body: <p>I am trying to pass a javascript object that contains </p>
  
  <pre><code>question(string), multianswers(answer(string),correct(bit)).
  </code></pre>
  
  <p>This is the value of multianswers -    </p>
  
  <pre><code>[{'correct':true,'answer':'A1'}, {'correct':true,'answer':'A2'}];
  </code></pre>
  
  <p>What type should be the parameter that I am passing to the controller.</p>
  
  <pre><code>function setMultiQuestion(question, responses) {
  
      var responsesList = angular.toJson(responses);
  
      function questionAnswerObj(question, answers)
      {
          this.question = question;
          this.answers = answers;
      }
  
      qaObject = new questionAnswerObj(question, responsesList);
  
      $http.post(baseUrl + "Admin/insertMultiAnswers", { data: qaObject })
    .success(function (data, status, headers, config) {
  
        $mdDialog.hide();
        $mdToast.show(
        $mdToast.simple()
       .textContent('New question was added.')
       .position('top')
       .hideDelay(5000)
       .theme('success-toast')
       );
    })
    .error(function (data, status, header, config) {
    });
  }
  </code></pre>
  
  <p>And this is my controller. </p>
  
  <pre><code> [HttpPost]
      public ActionResult insertMultiAnswers(object data)
      {
          try
          {
              Console.Write(data);
            //  data.setMultiAnswer();
              Response.StatusCode = 200;
              return Content("Sucess");
          }
          catch (Exception ex)
          {
              Response.StatusCode = 500;
              return Content("Fail");
          }
      }
  </code></pre>