title: How to POST object with Restangular?
body: <p>I want to send object to Spring Controller with Angular JS and Restangular. That is how I try to do this:</p>
  
  <pre><code>var scoreTO = {
      score: parseFloat($scope.score.score),
      percentage: parseFloat($scope.score.percentage),
      date: (new Date()).getTime()
  }
  Restangular.one("scores").post(scoreTO);
  </code></pre>
  
  <p>There is transport object:</p>
  
  <pre><code>public class ScoreTO implements Serializable{
  private double score;
  private double percentage;
  private long date;
  public ScoreTO(){}
  public ScoreTO(double score, double percentage, long date){
      this.score = score; this.percentage = percentage; this.date=date;
  }
  
  public double getScore() {
      return score;
  }
  
  public void setScore(double score) {
      this.score = score;
  }
  
  public double getPercentage() {
      return percentage;
  }
  
  public void setPercentage(double percentage) {
      this.percentage = percentage;
  }
  
  public long getDate() {
      return date;
  }
  
  public void setDate(long date) {
      this.date = date;
  }
  
  }
  </code></pre>
  
  <p>And there is how I try to catch request in Spring Controller:</p>
  
  <pre><code>@Controller
  @RequestMapping(value="/score")
      public class ScoreController {
  
      (...)
  
      @RequestMapping(value="/scores", method= RequestMethod.POST)
      @ResponseBody
      public String saveScore(@RequestBody ScoreTO scoreTO){
          scoreService.saveScore(scoreTO.getScore(), scoreTO.getPercentage(), 
                  new Date(scoreTO.getDate()));
          return "";
      }
  }
  </code></pre>
  
  <p>But if I try to send it, I got this error in browser console: 
  <code>POST http://localhost:8084/wpisywarkaAngular/score/scores/[object%20Object] 404 (Not Found)</code> 
  What am I doing wrong? I'll we very happy if anybody help me - thank you in advance.</p>