title: Swagger TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body
body: <p>I have added Swagger to my Spring Boot 2 application:</p>
  
  <p>This is my Swagger config:</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfig {
  
      @Bean
      public Docket api() {
          // @formatter:off
          return new Docket(DocumentationType.SWAGGER_2)  
                  .select()                                  
                  .apis(RequestHandlerSelectors.any())              
                  .paths(PathSelectors.any())                          
                  .build();
          // @formatter:on
      }
  }
  </code></pre>
  
  <p>This is Maven dependency:</p>
  
  <pre><code>&lt;!-- Swagger2 --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
      &lt;version&gt;2.8.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
      &lt;version&gt;2.8.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>When I try to invoke for example <a href="http://localhost:8080/api/actuator/auditevents" rel="noreferrer">http://localhost:8080/api/actuator/auditevents</a>  it fails with the following error:</p>
  
  <pre><code>TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4EyaE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4EyaE.png" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong and how to fix it ?</p>