RequestBuilder builder = request(url);
builder.myMethod = HTTPMethod.HEAD;
return builder;
}
@NotNull
<BUG>public static String createErrorMessage(@NotNull IOException e, @NotNull Request request) throws IOException {
</BUG>
URLConnection connection = request.getConnection();
<BUG>String errorMessage = "Cannot download '" + connection.getURL().toExternalForm() + "': " + e.getMessage() + "\n, headers: " + connection.getHeaderFields();
if (connection instanceof HttpURLConnection) {</BUG>
HttpURLConnection httpConnection = (HttpURLConnection)connection;

RequestBuilder builder = request(url);
builder.myMethod = HTTPMethod.HEAD;
return builder;
}
@NotNull
public static String createErrorMessage(@NotNull IOException e, @NotNull Request request, boolean includeHeaders) throws IOException {
URLConnection connection = request.getConnection();
StringBuilder builder = new StringBuilder();
builder.append("Cannot download '").append(connection.getURL().toExternalForm()).append("': ").append(e.getMessage());
if (includeHeaders) {
builder.append("\n, headers: ").append(connection.getHeaderFields());
}
if (connection instanceof HttpURLConnection) {
