org.resthub.web.support.XmlBodyWriter 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.XmlHelper;
public class XmlBodyWriter implements BodyWriter {
@Override
public boolean canWrite(String mediaType) {
return (mediaType != null && (mediaType.startsWith(Http.XML) || mediaType.endsWith("+xml")));
}
@Override
public String writeEntity(String mediaType, Object object) {
return XmlHelper.serialize(object);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy