Updated sample code to reflect changes.

This commit is contained in:
Andrew Young 2013-11-27 12:49:04 -08:00
parent 0d40a53e06
commit 9686ceed2d

View File

@ -12,6 +12,7 @@ import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.client.filter.LoggingFilter;
import com.sun.jersey.api.client.WebResource.Builder;
import javax.ws.rs.core.Response.Status.Family;
import javax.ws.rs.core.MediaType;
import java.util.Map;
@ -123,7 +124,10 @@ public class ApiInvoker {
else {
throw new ApiException(500, "unknown method type " + method);
}
if(response.getClientResponseStatus() == ClientResponse.Status.OK) {
if(response.getClientResponseStatus() == ClientResponse.Status.NO_CONTENT) {
return null;
}
else if(response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
return (String) response.getEntity(String.class);
}
else {