Package com.google.code.http4j.impl

Examples of com.google.code.http4j.impl.Get


    client = new BasicClient();
  }
 
  @Test
  public void submit() throws IOException, InterruptedException, URISyntaxException {
    Response response = client.submit(new Get("http://code.google.com/p/http4j/"));
    checkResponse(response);
  }
View Full Code Here


    executor = new BasicRequestExecutor(manager, cookieCache, parser);
  }
 
  @Test
  public void execute() throws URISyntaxException, InterruptedException, IOException {
    Request request = new Get("http://www.baidu.com/");
    Response response = executor.execute(request);
    Assert.assertNotNull(response);
    checkStatus(response);
    checkHeaders(response);
    checkCharsetAndEntity(response);
View Full Code Here

*/
public final class GetTestCase extends RequestTestCase {
 
  @Test(expectedExceptions = MalformedURLException.class)
  public void construct_cause_MalformedURLException() throws MalformedURLException, URISyntaxException {
    new Get("code.google.com/p/http4j");
  }
View Full Code Here

    assertion("http://127.0.0.1:8080/index.xhtml;jsessionid=ABCDE?user=colin","GET /index.xhtml;jsessionid=ABCDE?user=colin HTTP/1.1\r\nHost:127.0.0.1:8080\r\n" + getDefaultHeaderString() + "\r\n");
  }

  @Test(dependsOnMethods = "toMessage")
  public void addParameter_string_strings() throws URISyntaxException, IOException {
    Get get = new Get("http://www.google.com/search");
    get.addParameter("q", "http4j");
    assertion(get, "GET /search?q=http4j HTTP/1.1\r\nHost:www.google.com\r\n" + getDefaultHeaderString() + "\r\n");
    get.addParameter("m", "GET", "POST");
    assertion(get, "GET /search?q=http4j&m=GET&m=POST HTTP/1.1\r\nHost:www.google.com\r\n" + getDefaultHeaderString() + "\r\n");
  }
View Full Code Here

    assertion(get, "GET /search?q=http4j&m=GET&m=POST HTTP/1.1\r\nHost:www.google.com\r\n" + getDefaultHeaderString() + "\r\n");
  }
 
  @Test(dependsOnMethods = "toMessage")
  public void setHeader() throws URISyntaxException, IOException {
    Get get = new Get("http://www.google.com");
    get.setHeader(Headers.ACCEPT_CHARSET, "ISO-8859-1");
    assertion(get, "GET / HTTP/1.1\r\nHost:www.google.com\r\n" + getDefaultHeaderString() + "Accept-Charset:ISO-8859-1\r\n\r\n");
    get.setHeader(Headers.ACCEPT_CHARSET, "UTF-8");
    assertion(get, "GET / HTTP/1.1\r\nHost:www.google.com\r\n" + getDefaultHeaderString() + "Accept-Charset:UTF-8\r\n\r\n");
  }
View Full Code Here

    assertion(get, "GET / HTTP/1.1\r\nHost:www.google.com\r\n" + getDefaultHeaderString() + "Accept-Charset:UTF-8\r\n\r\n");
  }
 
  @Override
  protected Request createRequest(String url) throws MalformedURLException, URISyntaxException {
    return new Get(url);
  }
View Full Code Here

TOP

Related Classes of com.google.code.http4j.impl.Get

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.