public Request body(Object bean){
  Objects.requireNonNull(bean);
  ByteArrayOutputStream buffer=new ByteArrayOutputStream();
  try (OutputStreamWriter writer=new OutputStreamWriter(buffer);JsonWriterImpl jsonWriter=new JsonWriterImpl(writer)){
    jsonWriter.write(bean);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  _body=buffer.toByteArray();
  _type="application/json";
  return this;
}

public Request body ( Object bean ) { Objects . requireNonNull ( bean ) ; ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; try ( OutputStreamWriter writer = new OutputStreamWriter ( buffer ) ; JsonWriterImpl jsonWriter = new JsonWriterImpl ( writer ) ) { jsonWriter . write ( bean ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } _body = buffer . toByteArray ( ) ; _type = "application/json" ; return this ; }
supplied bean will be jsonencoded for posting to the specified url using application / json content - type
