com.github.bingoohuang.springrestclient.utils.RestClientUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-rest-client Show documentation
Show all versions of spring-rest-client Show documentation
convenient spring rest client for rest services
package com.github.bingoohuang.springrestclient.utils;
import com.mashape.unirest.http.HttpResponse;
public class RestClientUtils {
public static T nullOrBody(HttpResponse response) {
String returnNull = response.header("returnNull");
if ("true".equals(returnNull)) return null;
return response.getBody();
}
public static boolean isResponseJsonContentType(HttpResponse> response) {
String contentType = response.header("Content-Type");
return contentType != null && contentType.contains("application/json");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy