generalize java http client