Search in sources :

Example 36 with HttpUriRequest

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

the class HttpClientStackTest method createPostRequestWithBody.

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

Example 37 with HttpUriRequest

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

the class HttpClientStackTest method createPatchRequestWithBody.

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

Example 38 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 39 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 40 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)

Aggregations

HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)185 Test (org.junit.Test)62 TestRequest (com.android.volley.mock.TestRequest)52 HttpGet (org.apache.http.client.methods.HttpGet)45 URI (java.net.URI)43 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)22 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 StringEntity (org.apache.http.entity.StringEntity)10