title: "POST" method is throwing 500 code using rest-assured
body: <p>I created a post request using Student POJO in REST Assured libraries. Also added gson object serializer in pom.xml. However my code is not posting anything and I received 500 response code.</p>
  <p>Any help regarding this would be highly appreciable.</p>
  <p>When I pass the JSON as a string my code is working. It's only not working when passing the student object.</p>
  <pre class="lang-java prettyprint-override"><code>@Test
  public void createNewStudent() {
      Student student = new Student();
      Faker fake = new Faker();
      List&lt;String&gt; courses = new ArrayList&lt;String&gt;();
      courses.add(&quot;Accounting&quot;);
      courses.add(&quot;Statistics&quot;);              
      student.setFirstname(fake.name().firstName());
      student.setLastname(fake.name().lastName());
      student.setEmail(fake.internet().emailAddress());
      student.setProgramme(&quot;Financial Analysis&quot;);
      student.setCourses(courses);
      
      
      given()
      .when()
      .contentType(ContentType.JSON)
      .body(student)
      .post()
      .then()
      .statusCode(201)
      ;
  }
  </code></pre>
  <h2>Studet POJO</h2>
  <pre class="lang-java prettyprint-override"><code>public class Student {  
      public String getFirstname() {
          return firstname;
      }
      public void setFirstname(String firstname) {
          this.firstname = firstname;
      }
      public String getLastname() {
          return lastname;
      }
      public void setLastname(String lastname) {
          this.lastname = lastname;
      }
      public String getEmail() {
          return email;
      }
      public void setEmail(String email) {
          this.email = email;
      }
      public String getProgramme() {
          return programme;
      }
      public void setProgramme(String programme) {
          this.programme = programme;
      }
      public List&lt;String&gt; getCourses() {
          return courses;
      }
      public void setCourses(List&lt;String&gt; courses) {
          this.courses = courses;
      }
      private String firstname;
      private String lastname;
      private String email;
      private String programme;
      private List&lt;String&gt; courses;
      
  }   
  </code></pre>