Lines Matching refs:contentType
150 public abstract MediaType contentType();
165 * contentType} lacks a charset, this will use UTF-8.
167 public static Body create(MediaType contentType, String content) {
168 contentType = contentType.charset() != null
169 ? contentType
170 : MediaType.parse(contentType + "; charset=utf-8");
172 byte[] bytes = content.getBytes(contentType.charset().name());
173 return create(contentType, bytes);
180 public static Body create(final MediaType contentType, final byte[] content) {
181 if (contentType == null) throw new NullPointerException("contentType == null");
185 @Override public MediaType contentType() {
186 return contentType;
200 public static Body create(final MediaType contentType, final File file) {
201 if (contentType == null) throw new NullPointerException("contentType == null");
205 @Override public MediaType contentType() {
206 return contentType;