title: HttpClientResponseException: Empty body
body: <p>I am getting confuse to using <code>declarative http client</code>.</p>
  
  <p>I am trying to test to create a <code>declarative http client</code>. But I am getting this error.</p>
  
  <pre><code>15:34:16.455 [pool-1-thread-1] ERROR i.m.r.intercept.RecoveryInterceptor - Type [micronaut.http.client.repository.ItunesClient$Intercepted] executed with error: Empty body
  io.micronaut.http.client.exceptions.HttpClientResponseException: Empty body
          at io.micronaut.http.client.BlockingHttpClient.lambda$retrieve$0(BlockingHttpClient.java:140)
          at java.util.Optional.orElseThrow(Optional.java:290)
          at io.micronaut.http.client.BlockingHttpClient.retrieve(BlockingHttpClient.java:140)
          at io.micronaut.http.client.interceptor.HttpClientIntroductionAdvice.intercept(HttpClientIntroductionAdvice.java:535)
          at io.micronaut.aop.MethodInterceptor.intercept(MethodInterceptor.java:40)
          at io.micronaut.aop.chain.InterceptorChain.proceed(InterceptorChain.java:146)
          at io.micronaut.retry.intercept.RecoveryInterceptor.intercept(RecoveryInterceptor.java:73)
          at io.micronaut.aop.MethodInterceptor.intercept(MethodInterceptor.java:40)
          at io.micronaut.aop.chain.InterceptorChain.proceed(InterceptorChain.java:146)
          at micronaut.http.client.repository.ItunesClient$Intercepted.search(Unknown Source)
          at micronaut.http.client.controller.MusicController.search(MusicController.java:37)
          at micronaut.http.client.controller.$MusicControllerDefinition$$exec1.invokeInternal(Unknown Source)
          at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:144)
          at io.micronaut.context.DefaultBeanContext$BeanExecutionHandle.invoke(DefaultBeanContext.java:2694)
          at io.micronaut.web.router.AbstractRouteMatch.execute(AbstractRouteMatch.java:295)
          at io.micronaut.web.router.RouteMatch.execute(RouteMatch.java:122)
          at io.micronaut.http.server.netty.RoutingInBoundHandler.lambda$buildResultEmitter$17(RoutingInBoundHandler.java:1358)
  
  </code></pre>
  
  <p>this is my code.
  <a href="https://github.com/akyong/micronaut-http-client/blob/master/src/main/java/micronaut/http/client/controller/MusicController.java#L25-L37" rel="nofollow noreferrer">https://github.com/akyong/micronaut-http-client/blob/master/src/main/java/micronaut/http/client/controller/MusicController.java#L25-L37</a></p>
  
  <p>it works if i change <code>List&lt;Album&gt;</code> to <code>String</code> like this.</p>
  
  <pre><code>public String search(String searchTerm, @Nullable @QueryValue String maxResults) {
          log.info("searchTerm : {}",searchTerm);
          log.info("maxResults : {}",maxResults);
          final int limit;
          if(StringUtils.isDigits(maxResults)) {
              limit = Math.min(25, Integer.parseInt(maxResults));
          } else {
              limit = 25;
          }
  
          String result = itunesClient.search(searchTerm, limit);
          return result;
      }
  </code></pre>
  
  <p>ItunesClient</p>
  
  <pre><code>@Get("/search?limit={maxResults}&amp;media=music&amp;entity=album&amp;term={term}")
      String search(String term, int maxResults);//From SearchResults to String
  </code></pre>