
org.resthub.web.support.JsonBodyWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resthub-web-client Show documentation
Show all versions of resthub-web-client Show documentation
RESThub webservice client for requesting REST webservices with JSON support bundled
The newest version!
package org.resthub.web.support;
import org.resthub.web.Http;
import org.resthub.web.JsonHelper;
public class JsonBodyWriter implements BodyWriter {
@Override
public boolean canWrite(String mediaType) {
return (mediaType != null && (mediaType.startsWith(Http.JSON) || mediaType.endsWith("+json")));
}
@Override
public String writeEntity(String mediaType, Object object) {
return JsonHelper.serialize(object);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy