Class JacksonMapperHttpContent

  • All Implemented Interfaces:
    com.google.api.client.http.HttpContent, com.google.api.client.util.StreamingContent

    public class JacksonMapperHttpContent
    extends com.google.api.client.http.AbstractHttpContent
    JSON deserializer implementation based on Jackson databinding module. Usage: HttpContent content = new JacksonMapperHttpContent(new ObjectMapper(), data); HttpRequest request = requestFactory.buildPostRequest(url, content); HttpResponse response = request.execute(); Implementation is not thread-safe.
    • Constructor Summary

      Constructors 
      Constructor Description
      JacksonMapperHttpContent​(com.fasterxml.jackson.databind.ObjectMapper objectMapper, java.lang.Object data)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void writeTo​(java.io.OutputStream out)  
      • Methods inherited from class com.google.api.client.http.AbstractHttpContent

        computeLength, computeLength, getCharset, getLength, getMediaType, getType, retrySupported, setMediaType
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JacksonMapperHttpContent

        public JacksonMapperHttpContent​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                        java.lang.Object data)
        Parameters:
        objectMapper - Jackson databinder
        data - JSON key name/value data
    • Method Detail

      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Throws:
        java.io.IOException