title: GET REST error 415
body: <p>I am getting the following error message when trying to execute a GET REST command:</p>
  
  <p>"returned a response status of 415 Unsupported Media Type"</p>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;code&gt; whenGetPatternByGroupName() {
          Client client = Client.create(new DefaultClientConfig());
  
          URI uri = UriBuilder.fromUri("http://bla:7979/bla/rest/pattern/").build();
          WebResource service = client.resource(uri);
  
          List &lt;PatternList&gt; patternList = new ArrayList&lt;PatternList&gt;();
          patternList = service.path("getAll").type(MediaType.APPLICATION_XML).get(patternList.getClass());
  
          assertThat(patternList.size(), greaterThan(0));
       }
  &lt;/code&gt;
  
  &lt;code&gt; @GET
      @Path("getAll")
      @Consumes({MediaType.APPLICATION_JSON})
      public List&lt;PatternList&gt; getAllPatterns() { 
          ArrayList&lt;PatternList&gt; list = new ArrayList&lt;PatternList&gt;();
  
          // put group names here
          String[] groups = new String[] {"Group 1"};
  
          for (String groupName : groups) {
  
              List&lt;String&gt; patterns = patternPersistenceService.getListByGroupName(groupName);
  
              PatternList patternList = new PatternList();
              patternList.setGroupName(groupName);
              patternList.setPatterns(patterns);
  
              list.add(patternList); 
          }
          return list;
      }
  &lt;/code&gt;
  </code></pre>
  
  <p>Does anyone have any ideas what could be causing this??</p>
  
  <p>Thanks,</p>