title: Spring WebClient put Mapping: Content type 'application/json' not supported
body: <p>I am trying to use WebClient to call by REST another service, but I always get error:</p>
  
  <blockquote>
    <p>org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type 'application/json' not supported</p>
  </blockquote>
  
  <p>All allocations have same version of dependencies, calling the resources through Postman works fine. The problem is when first application, acting as a proxy (client), tries to call second one (service)</p>
  
  <p>My Server resource:</p>
  
  <pre><code>@RequestMapping(value = "/properties")
  @PutMapping(consumes = APPLICATION_JSON_UTF8_VALUE)
  @ResponseStatus(CREATED)
  public void saveProperty(@Valid @RequestBody PropertyForm form) {
      service.save(new PropertyImpl(form));
  }
  </code></pre>
  
  <p>My Client resource:</p>
  
  <pre><code>WebClient client = WebClient.create(serviceUrl);
  
  Mono&lt;Void&gt; save(PropertyForm form) {
      return client.put()
              .uri("properties")
              .contentType(MediaType.APPLICATION_JSON_UTF8)
              .body(BodyInserters.fromObject(form))
              .retrieve()
              .bodyToMono(Void.class);
  }
  </code></pre>
  
  <p>My build.gradle file:</p>
  
  <pre><code>dependencies {
      compile "org.springframework.boot:spring-boot-starter-reactor-netty:2.0.4.RELEASE"
      compile "org.springframework.boot:spring-boot-starter-web:2.0.4.RELEASE"
      compile "org.springframework:spring-webflux:5.0.4.RELEASE"
  
      compile "javax.xml.bind:jaxb-api:2.3.0"
  }
  </code></pre>
  
  <p>Am I missing some dependency, to enable JSON contentType? This example is very simple, yet very problematic for me also.</p>
  
  <p>Form model:</p>
  
  <pre><code>class PropertyForm {
  
      private String group;
      private String key;
      private String value;
      // getters &amp; setters
  }
  </code></pre>
  
  <p>Source: <a href="https://gitlab.com/Berilzar/Sandbox" rel="nofollow noreferrer">https://gitlab.com/Berilzar/Sandbox</a></p>