some comments
parent
2622b448b8
commit
abd020b45b
|
@ -112,7 +112,7 @@ public class HttpClientDownloader extends AbstractDownloader {
|
|||
}
|
||||
|
||||
protected Page handleResponse(Request request, String charset, HttpResponse httpResponse, Task task) throws IOException {
|
||||
String content = getContent(charset, httpResponse);
|
||||
String content = getResponseContent(charset, httpResponse);
|
||||
Page page = new Page();
|
||||
page.setRawText(content);
|
||||
page.setUrl(new PlainText(request.getUrl()));
|
||||
|
@ -124,7 +124,7 @@ public class HttpClientDownloader extends AbstractDownloader {
|
|||
return page;
|
||||
}
|
||||
|
||||
private String getContent(String charset, HttpResponse httpResponse) throws IOException {
|
||||
private String getResponseContent(String charset, HttpResponse httpResponse) throws IOException {
|
||||
if (charset == null) {
|
||||
byte[] contentBytes = IOUtils.toByteArray(httpResponse.getEntity().getContent());
|
||||
String htmlCharset = getHtmlCharset(httpResponse, contentBytes);
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.apache.http.client.protocol.HttpClientContext;
|
|||
* @author code4crafter@gmail.com
|
||||
* Date: 17/4/8
|
||||
* Time: 19:43
|
||||
* @since 0.7.0
|
||||
*/
|
||||
public class HttpClientRequestContext {
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@ import java.util.Map;
|
|||
/**
|
||||
* @author code4crafter@gmail.com
|
||||
* Date: 17/3/18
|
||||
* Time: 上午11:28
|
||||
* Time: 11:28
|
||||
*
|
||||
* @since 0.7.0
|
||||
*/
|
||||
public class HttpUriRequestConverter {
|
||||
|
||||
|
|
Loading…
Reference in New Issue