
uk.co.autotrader.traverson.http.entity.TextEntityConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of traverson4j-hc5 Show documentation
Show all versions of traverson4j-hc5 Show documentation
An Apache HttpComponents 5 client to power traverson4j-core
package uk.co.autotrader.traverson.http.entity;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.io.entity.StringEntity;
import uk.co.autotrader.traverson.http.Body;
import uk.co.autotrader.traverson.http.TextBody;
class TextEntityConverter implements HttpEntityConverter {
@Override
public HttpEntity toEntity(Body body) {
TextBody textBody = (TextBody) body;
return new StringEntity(textBody.getContent(), ContentType.create(body.getContentType(), textBody.getCharset()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy