Package com.anthavio.httl.inout

Examples of com.anthavio.httl.inout.RequestBodyMarshaller


          if (fake.getValue() instanceof String) {
            String string = (String) fake.getValue();
            byte[] dataBytes = string.getBytes(charset);
            writeBytes(connection, dataBytes);
          } else {
            RequestBodyMarshaller marshaller = getRequestMarshaller(mimeType);
            if (marshaller == null) {
              throw new IllegalArgumentException("Request body marshaller not found for " + mimeType);
            }
            if (fake.isStreaming()) {
              marshaller.write(fake.getValue(), connection.getOutputStream(), charset);
            } else {
              //XXX create string first an then write...
              marshaller.write(fake.getValue(), connection.getOutputStream(), charset);
            }
          }
        } else {
          writeStream(connection, stream);
        }
View Full Code Here


      if (stream instanceof FakeStream) {
        FakeStream fake = (FakeStream) stream;
        if (fake.getValue() instanceof String) {
          entity = new StringRequestEntity((String) fake.getValue(), null, charset.name());
        } else {
          RequestBodyMarshaller marshaller = getRequestMarshaller(mimeType);
          if (marshaller == null) {
            throw new IllegalArgumentException("Request body marshaller not found for " + mimeType);
          }
          entity = new ObjectEntity(fake.getValue(), charset, marshaller, fake.isStreaming());
        }
View Full Code Here

      if (stream instanceof FakeStream) {
        FakeStream fake = (FakeStream) stream;
        if (fake.getValue() instanceof String) {
          entity = new StringEntity((String) fake.getValue(), charset);
        } else {
          RequestBodyMarshaller marshaller = getRequestMarshaller(mimeType);
          if (marshaller == null) {
            throw new IllegalArgumentException("Request body marshaller not found for " + mimeType);
          }
          entity = new ObjectHttpEntity(fake.getValue(), charset, marshaller, fake.isStreaming());
        }
View Full Code Here

TOP

Related Classes of com.anthavio.httl.inout.RequestBodyMarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.