Search in sources :

Example 21 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project FastDev4Android by jiangqqlmj.

the class HttpClientStackTest method createPutRequestWithBody.

@Test
public void createPutRequestWithBody() throws Exception {
    TestRequest.PutWithBody request = new TestRequest.PutWithBody();
    assertEquals(request.getMethod(), Method.PUT);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpPut);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpPut(org.apache.http.client.methods.HttpPut) TestRequest(com.android.volley.mock.TestRequest) Test(org.junit.Test)

Example 22 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project FastDev4Android by jiangqqlmj.

the class HttpClientStackTest method createHeadRequest.

@Test
public void createHeadRequest() throws Exception {
    TestRequest.Head request = new TestRequest.Head();
    assertEquals(request.getMethod(), Method.HEAD);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpHead);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpHead(org.apache.http.client.methods.HttpHead) HttpHead(org.apache.http.client.methods.HttpHead) TestRequest(com.android.volley.mock.TestRequest) Test(org.junit.Test)

Example 23 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project FastDev4Android by jiangqqlmj.

the class HttpClientStackTest method createOptionsRequest.

@Test
public void createOptionsRequest() throws Exception {
    TestRequest.Options request = new TestRequest.Options();
    assertEquals(request.getMethod(), Method.OPTIONS);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpOptions);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpOptions(org.apache.http.client.methods.HttpOptions) HttpOptions(org.apache.http.client.methods.HttpOptions) TestRequest(com.android.volley.mock.TestRequest) Test(org.junit.Test)

Example 24 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project android-volley by mcxiaoke.

the class HttpClientStackTest method createPutRequestWithBody.

@Test
public void createPutRequestWithBody() throws Exception {
    TestRequest.PutWithBody request = new TestRequest.PutWithBody();
    assertEquals(request.getMethod(), Method.PUT);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpPut);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpPut(org.apache.http.client.methods.HttpPut) TestRequest(com.android.volley.mock.TestRequest) Test(org.junit.Test)

Example 25 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project android-volley by mcxiaoke.

the class HttpClientStackTest method createOptionsRequest.

@Test
public void createOptionsRequest() throws Exception {
    TestRequest.Options request = new TestRequest.Options();
    assertEquals(request.getMethod(), Method.OPTIONS);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpOptions);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpOptions(org.apache.http.client.methods.HttpOptions) HttpOptions(org.apache.http.client.methods.HttpOptions) TestRequest(com.android.volley.mock.TestRequest) Test(org.junit.Test)

Aggregations

HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)183 Test (org.junit.Test)62 TestRequest (com.android.volley.mock.TestRequest)52 HttpGet (org.apache.http.client.methods.HttpGet)44 URI (java.net.URI)41 HttpResponse (org.apache.http.HttpResponse)41 HttpEntity (org.apache.http.HttpEntity)38 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)36 HttpPost (org.apache.http.client.methods.HttpPost)21 IOException (java.io.IOException)19 Header (org.apache.http.Header)18 JSONObject (org.json.JSONObject)18 BufferedReader (java.io.BufferedReader)17 InputStreamReader (java.io.InputStreamReader)17 PrintWriter (java.io.PrintWriter)17 StringWriter (java.io.StringWriter)17 HttpHost (org.apache.http.HttpHost)13 HttpPut (org.apache.http.client.methods.HttpPut)12 HttpEntityEnclosingRequest (org.apache.http.HttpEntityEnclosingRequest)11 HttpParams (org.apache.http.params.HttpParams)10