Search in sources :

Example 76 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project TaEmCasa by Dionen.

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 77 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project TaEmCasa by Dionen.

the class HttpClientStackTest method createPostRequest.

@Test
public void createPostRequest() throws Exception {
    TestRequest.Post request = new TestRequest.Post();
    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) HttpPost(org.apache.http.client.methods.HttpPost) TestRequest(com.android.volley.mock.TestRequest) Test(org.junit.Test)

Example 78 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project TaEmCasa by Dionen.

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 79 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project TaEmCasa by Dionen.

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 80 with HttpUriRequest

use of org.apache.http.client.methods.HttpUriRequest in project TaEmCasa by Dionen.

the class HttpClientStackTest method createDeprecatedGetRequest.

@Test
public void createDeprecatedGetRequest() throws Exception {
    TestRequest.DeprecatedGet request = new TestRequest.DeprecatedGet();
    assertEquals(request.getMethod(), Method.DEPRECATED_GET_OR_POST);
    HttpUriRequest httpRequest = HttpClientStack.createHttpRequest(request, null);
    assertTrue(httpRequest instanceof HttpGet);
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) HttpGet(org.apache.http.client.methods.HttpGet) 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