com.buyexpressly.api.resource.server.XlyQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plugin-sdk Show documentation
Show all versions of plugin-sdk Show documentation
Expressly Java SDK to integrate e-commerce platforms with the Expressly Network API
package com.buyexpressly.api.resource.server;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.codehaus.jackson.map.ObjectMapper;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
public class XlyQuery extends StringEntity {
public XlyQuery(String string) throws UnsupportedEncodingException {
super(string, ContentType.APPLICATION_JSON);
}
public static XlyQuery toJsonEntity(T request) throws IOException {
String json = new ObjectMapper().writer().writeValueAsString(request);
return new XlyQuery(json);
}
}