
com.github.sheigutn.pushbullet.util.HttpUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pushbullet-java-8 Show documentation
Show all versions of pushbullet-java-8 Show documentation
Pushbullet Library for Java 8
The newest version!
package com.github.sheigutn.pushbullet.util;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
public class HttpUtil {
/**
* Get a header value of {@link HttpResponse} or a default value
* @param response The response to get the header from
* @param headerName The name of the header
* @param defaultValue The default value
* @return The header value or the default value
*/
public static String getHeaderValue(HttpResponse response, String headerName, String defaultValue) {
Header header;
return ((header = response.getFirstHeader(headerName)) != null) ? header.getValue() : defaultValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy