/* package whatever; // don't place package name! */ package threadupdate; import java.io.*; import java.util.*; import java.io.IOException; import org.apache.http.client.*; import org.apache.http.client.methods.*; import java.util.List; import org.apache.http.client.entity.*; import org.apache.http.impl.client.*; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.apache.http.HttpResponse; import org.apache.http.HttpEntity; import org.apache.http.util.EntityUtils; class Search { HttpClient httpclient = HttpClients.createDefault(); HttpPost httppost = new HttpPost("boards.4chan.org/int/catalog#s="); // Request parameters and other properties. List<NameValuePair> params = new ArrayList<NameValuePair>(1); params.add(new BasicNameValuePair("qf-box", "balt")); httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); //Execute and get the response. HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); if (entity != null) { try { } catch (ClientProtocolException e) { // writing exception to log e.printStackTrace(); // writing exception to log e.printStackTrace(); } finally { instream.close(); } } } }
Standard input is empty
Main.java:7: error: package org.apache.http.client does not exist
import org.apache.http.client.*;
^
Main.java:8: error: package org.apache.http.client.methods does not exist
import org.apache.http.client.methods.*;
^
Main.java:10: error: package org.apache.http.client.entity does not exist
import org.apache.http.client.entity.*;
^
Main.java:11: error: package org.apache.http.impl.client does not exist
import org.apache.http.impl.client.*;
^
Main.java:12: error: package org.apache.http does not exist
import org.apache.http.NameValuePair;
^
Main.java:13: error: package org.apache.http.message does not exist
import org.apache.http.message.BasicNameValuePair;
^
Main.java:14: error: package org.apache.http does not exist
import org.apache.http.HttpResponse;
^
Main.java:15: error: package org.apache.http does not exist
import org.apache.http.HttpEntity;
^
Main.java:16: error: package org.apache.http.util does not exist
import org.apache.http.util.EntityUtils;
^
Main.java:23: error: cannot find symbol
HttpClient httpclient = HttpClients.createDefault();
^
symbol: class HttpClient
location: class Search
Main.java:23: error: cannot find symbol
HttpClient httpclient = HttpClients.createDefault();
^
symbol: variable HttpClients
location: class Search
Main.java:24: error: cannot find symbol
HttpPost httppost = new HttpPost("boards.4chan.org/int/catalog#s=");
^
symbol: class HttpPost
location: class Search
Main.java:24: error: cannot find symbol
HttpPost httppost = new HttpPost("boards.4chan.org/int/catalog#s=");
^
symbol: class HttpPost
location: class Search
Main.java:27: error: cannot find symbol
List<NameValuePair> params = new ArrayList<NameValuePair>(1);
^
symbol: class NameValuePair
location: class Search
Main.java:27: error: cannot find symbol
List<NameValuePair> params = new ArrayList<NameValuePair>(1);
^
symbol: class NameValuePair
location: class Search
Main.java:28: error: cannot find symbol
params.add(new BasicNameValuePair("qf-box", "balt"));
^
symbol: class BasicNameValuePair
location: class Search
Main.java:29: error: cannot find symbol
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
^
symbol: class UrlEncodedFormEntity
location: class Search
Main.java:32: error: cannot find symbol
HttpResponse response = httpclient.execute(httppost);
^
symbol: class HttpResponse
location: class Search
Main.java:33: error: cannot find symbol
HttpEntity entity = response.getEntity();
^
symbol: class HttpEntity
location: class Search
Main.java:38: error: cannot find symbol
String content = EntityUtils.toString(entity);
^
symbol: variable EntityUtils
location: class Search
Main.java:41: error: cannot find symbol
catch (ClientProtocolException e) {
^
symbol: class ClientProtocolException
location: class Search
21 errors
Standard output is empty