title: Content type 'application/json;charset=UTF-8' not supported
body: <p>I am creating a newsletter API using java spring framework. Whenever I am hitting the API as a post with request model getting this excetion org.springframework.web.HttpMediaTypeNotSupportedException.</p>
  
  <p>This is my newsletter model</p>
  
  <pre><code>@Entity
  @Table(name = "ns_newsletters")
  public class Newsletter extends DomainObject {
  
  @Id
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "newsletter_gen")
  @TableGenerator(name = "newsletter_gen", table = "ns_newsletter_id_gen", pkColumnName = "GEN_NAME", valueColumnName = "GEN_VAL", pkColumnValue = "NewsletterId_Gen", initialValue = 1, allocationSize = 1)
  @Column(name = "subscriber_id")
  private int subscriberId;
  
  @Column(name = "subscriber_email_address")
  private String subscriberEmailAddress;
  
  @Column(name = "is_subscribe")
  public boolean isSubscribe;
  
  @Column(name = "first_name")
  private String firstName;
  
  @Column(name = "last_name")
  private String lastName;
  
  @Column(name = "gender")
  private String gender;
  
  @JsonManagedReference
  @ManyToMany(cascade = CascadeType.ALL)
  @JoinTable(name = "ns_newsletter_mailer_list_linkage", joinColumns = {@JoinColumn(name = "subscriber_id")},
          inverseJoinColumns = {@JoinColumn(name = "newsletter_mailer_id")})
  private Set&lt;NewsletterMailerList&gt; mailerLists;
  
  
  public Newsletter() {
      super();
  }
  
  public Newsletter(String createdBy, Timestamp creationDate, int version, Timestamp lastModifiedDate,
                    String lastModifiedBy, RecordStatus recordStatus) {
      super(createdBy, creationDate, version, lastModifiedDate, lastModifiedBy, recordStatus);
  }
  
   public Newsletter(Set&lt;NewsletterMailerList&gt; mailerLists, int subscriberId, String subscriberEmailId, boolean isSubscribe, String firstName, String lastName, String sex) {
      super();
      this.subscriberId = subscriberId;
      this.subscriberEmailAddress = subscriberEmailId;
      this.isSubscribe = isSubscribe;
      this.firstName = firstName;
      this.lastName = lastName;
      this.gender = sex;
      this.mailerLists = mailerLists;
  }
  
  public int getSubscriberId() {
      return subscriberId;
  }
  
  public void setSubscriberId(int subscriberId) {
      this.subscriberId = subscriberId;
  }
  
  public String getSubscriberEmailAddress() {
      return subscriberEmailAddress;
  }
  
  public void setSubscriberEmailAddress(String subscriberEmailAddress) {
      this.subscriberEmailAddress = subscriberEmailAddress;
  }
  
  public boolean isSubscribe() {
      return isSubscribe;
  }
  
  public void setSubscribe(boolean subscribe) {
      isSubscribe = subscribe;
  }
  
  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 getGender() {
      return gender;
  }
  
  public void setGender(String gender) {
      this.gender = gender;
  }
  
  public Set&lt;NewsletterMailerList&gt; getMailerLists() {
      return mailerLists;
  }
  
  public void setMailerLists(Set&lt;NewsletterMailerList&gt; mailerLists) {
      this.mailerLists = mailerLists;
  }
  }
  </code></pre>
  
  <p>This is my NewsletterMailerList model</p>
  
  <pre><code>@Entity
  @Table(name = "ns_newsletter_mailer_list")
  public class NewsletterMailerList extends DomainObject {
  
  @Id
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "newsletter_mailer_list_gen")
  @TableGenerator(name = "newsletter_mailer_list_gen", table = "ns_newsletter_mailer_list_id_gen", pkColumnName = "GEN_NAME", valueColumnName = "GEN_VAL", pkColumnValue = "NewsletterMailerList_Gen", initialValue = 1000, allocationSize = 1)
  @Column(name = "newsletter_mailer_id")
  private int newsletterMailerId;
  
  @Column(name = "mailer_list_name")
  private String mailerListName;
  
  @Column(name = "description")
  private String description;
  
  @JsonBackReference
  @ManyToMany(cascade = CascadeType.ALL, mappedBy = "mailerLists")
  private Set&lt;Newsletter&gt; newsletters;
  
  public Set&lt;Newsletter&gt; getNewsletter() {
      return newsletters;
  }
  
  public void setNewsletter(Set&lt;Newsletter&gt; newsletters) {
      this.newsletters = newsletters;
  }
  
  public int getNewsletterMailerId() {
      return newsletterMailerId;
  }
  
  public void setNewsletterMailerId(int newsletterMailerId) {
      this.newsletterMailerId = newsletterMailerId;
  }
  
  public String getMailerListName() {
      return mailerListName;
  }
  
  public void setMailerListName(String mailerListName) {
      this.mailerListName = mailerListName;
  }
  
  public String getDescription() {
      return description;
  }
  
  public void setDescription(String description) {
      this.description = description;
  }
  
  public Set&lt;Newsletter&gt; getNewsletters() {
      return newsletters;
  }
  
  public void setNewsletters(Set&lt;Newsletter&gt; newsletters) {
      this.newsletters = newsletters;
  }
  }
  </code></pre>
  
  <p>I give contain type as application/json.
  I am new to do this kind of stuff. Please help me why I am getting this error. If you need anything more let me know.</p>
  
  <p>This is Newsletter Controller</p>
  
  <pre><code>package com.neostencil.modules.newslettermanagement.controller;
  
  
  import com.neostencil.framework.base.BaseResponse;
  import com.neostencil.framework.enums.StatusType;
  import com.neostencil.framework.utilities.common.CollectionUtil;
  import io.swagger.annotations.Api;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.http.HttpStatus;
  import org.springframework.http.RequestEntity;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Set;
  
  @RestController
  @RequestMapping(value = "api/v1")
  @Api(value = "Newsletter", description = "Rest API for Newsletter 
  operations", tags = "Newsletter API")
  public class NewsletterController {
  
  @Autowired
  NewsletterService newsletterService;
  
  @RequestMapping(value = "/newsletters", method = RequestMethod.POST)
  public ResponseEntity&lt;BaseResponse&gt; addNewsletter(RequestEntity&lt;SingleNewsletterRequest&gt; request) {
  
      ResponseEntity&lt;BaseResponse&gt; response = null;
      BaseResponse baseResponse = new BaseResponse();
      List&lt;String&gt; messages = new ArrayList&lt;&gt;();
  
      if (request.getBody() == null) {
          baseResponse.setStatus(StatusType.NOT_FOUND);
          messages.add("Newsletter request is empty or null");
          baseResponse.setMessages(messages);
          response = new ResponseEntity&lt;BaseResponse&gt;(baseResponse, HttpStatus.BAD_REQUEST);
      } else {
          Newsletter newsletter = request.getBody().getNewsletter();
          Set&lt;NewsletterMailerList&gt; mailerLists = request.getBody().getNewsletter().getMailerLists();
  
          if (CollectionUtil.isEmpty(mailerLists) || !mailerLists.contains(MailerListType.list_1) || !mailerLists.contains(MailerListType.list_2)) {
              NewsletterMailerList newsletterMailerList1 = new NewsletterMailerList();
              newsletterMailerList1.setMailerListName(MailerListType.list_1);
  
              NewsletterMailerList newsletterMailerList2 = new NewsletterMailerList();
              newsletterMailerList2.setMailerListName(MailerListType.list_2);
  
              mailerLists.add(newsletterMailerList1);
              mailerLists.add(newsletterMailerList2);
  
              newsletter.setMailerLists(mailerLists);
          }
  
  
          newsletterService.addNewsletter(newsletter);
          baseResponse.setStatus(StatusType.SUCCESSFUL);
          messages.add("Newsletter added successfully");
          baseResponse.setMessages(messages);
          response = new ResponseEntity&lt;BaseResponse&gt;(baseResponse, HttpStatus.OK);
  
  
      }
  
      return response;
  
  
  }
  }
  </code></pre>
  
  <p>This is request  class </p>
  
  <pre><code>public class SingleNewsletterRequest {
  
  Newsletter newsletter;
  
  public Newsletter getNewsletter() {
      return newsletter;
  }
  
  public void setNewsletter(Newsletter newsletter) {
      this.newsletter = newsletter;
  }
  }
  </code></pre>