added GSON support
only write and flush HttpContent if bytes are available