Home
last modified time | relevance | path

Searched refs:responseBody (Results 1 – 13 of 13) sorted by relevance

/external/robolectric/v1/src/main/java/com/xtremelabs/robolectric/tester/org/apache/http/
DTestHttpResponse.java25 private byte[] responseBody; field in TestHttpResponse
34 this.responseBody = new byte[0]; in TestHttpResponse()
37 public TestHttpResponse(int statusCode, String responseBody) { in TestHttpResponse() argument
39 this.responseBody = responseBody.getBytes(); in TestHttpResponse()
42 public TestHttpResponse(int statusCode, String responseBody, Header... headers) { in TestHttpResponse() argument
43 this(statusCode, responseBody.getBytes(), headers); in TestHttpResponse()
46 public TestHttpResponse(int statusCode, byte[] responseBody, Header... headers) { in TestHttpResponse() argument
48 this.responseBody = responseBody.clone(); in TestHttpResponse()
52 protected void setResponseBody(String responseBody) { in setResponseBody() argument
53 this.responseBody = responseBody.getBytes(); in setResponseBody()
[all …]
DFakeHttpLayer.java37 public void addPendingHttpResponse(int statusCode, String responseBody, Header... headers) { in addPendingHttpResponse() argument
38 addPendingHttpResponse(new TestHttpResponse(statusCode, responseBody, headers)); in addPendingHttpResponse()
88 public void setDefaultHttpResponse(int statusCode, String responseBody) { in setDefaultHttpResponse() argument
89 setDefaultHttpResponse(new TestHttpResponse(statusCode, responseBody)); in setDefaultHttpResponse()
/external/nanohttpd/core/src/test/java/fi/iki/elonen/integration/
DGetAndPostIntegrationTest.java107 String responseBody = this.httpclient.execute(httpget, responseHandler); in testGetRequestWithParameters() local
109 assertEquals("GET:testGetRequestWithParameters-params=2;age=120;gender=Male", responseBody); in testGetRequestWithParameters()
123 String responseBody = this.httpclient.execute(httppost, responseHandler); in testPostRequestWithFormEncodedParameters() local
125 …Equals("POST:testPostRequestWithFormEncodedParameters-params=2;age=120;gender=Male", responseBody); in testPostRequestWithFormEncodedParameters()
139 String responseBody = this.httpclient.execute(httppost, responseHandler); in testPostRequestWithMultipartEncodedParameters() local
141 …s("POST:testPostRequestWithMultipartEncodedParameters-params=2;age=120;gender=Male", responseBody); in testPostRequestWithMultipartEncodedParameters()
150 String responseBody = this.httpclient.execute(httppost, responseHandler); in testPostWithNoParameters() local
152 assertEquals("POST:testPostWithNoParameters", responseBody); in testPostWithNoParameters()
161 String responseBody = this.httpclient.execute(httpget, responseHandler); in testSimpleGetRequest() local
163 assertEquals("GET:testSimpleGetRequest", responseBody); in testSimpleGetRequest()
[all …]
DPutStreamIntegrationTest.java95 String responseBody = this.httpclient.execute(httpput, responseHandler); in testSimplePutRequest() local
97 assertEquals("PUT:" + expected, responseBody); in testSimplePutRequest()
/external/okhttp/samples/guide/src/main/java/com/squareup/okhttp/recipes/
DProgress.java70 private final ResponseBody responseBody; field in Progress.ProgressResponseBody
74 public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { in ProgressResponseBody() argument
75 this.responseBody = responseBody; in ProgressResponseBody()
80 return responseBody.contentType(); in contentType()
84 return responseBody.contentLength(); in contentLength()
89 bufferedSource = Okio.buffer(source(responseBody.source())); in source()
101 progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); in source()
/external/nanohttpd/core/src/test/java/fi/iki/elonen/
DHttpGetRequestTest.java170 String responseBody = "Success!"; in testOutputOfServeSentBackToClient() local
171 this.testServer.response = NanoHTTPD.newFixedLengthResponse(responseBody); in testOutputOfServeSentBackToClient()
181 responseBody in testOutputOfServeSentBackToClient()
DHttpHeadRequestTest.java50 String responseBody = "Success!"; in setUp() local
51 this.testServer.response = NanoHTTPD.newFixedLengthResponse(responseBody); in setUp()
/external/okhttp/okhttp-android-support/src/test/java/com/squareup/okhttp/internal/huc/
DJavaApiConverterTest.java349 ResponseBody responseBody = createResponseBody("BodyText"); in createJavaUrlConnection_responseHeadersOk() local
358 .addHeader("Content-Length", Long.toString(responseBody.contentLength())) in createJavaUrlConnection_responseHeadersOk()
359 .body(responseBody) in createJavaUrlConnection_responseHeadersOk()
366 assertEquals(responseBody.contentLength(), httpUrlConnection.getContentLength()); in createJavaUrlConnection_responseHeadersOk()
529 ResponseBody responseBody = createResponseBody("ResponseBody"); in createJavaCacheResponse_httpPost() local
537 .body(responseBody) in createJavaCacheResponse_httpPost()
553 ResponseBody responseBody = createResponseBody("ResponseBody"); in createJavaCacheResponse_httpsPost() local
563 .body(responseBody) in createJavaCacheResponse_httpsPost()
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/
DThreadInterruptTest.java113 InputStream responseBody = connection.getInputStream(); in interruptReadingResponseBody() local
116 while (responseBody.read(buffer) != -1) { in interruptReadingResponseBody()
DDisconnectTest.java111 InputStream responseBody = connection.getInputStream(); in interruptReadingResponseBody() local
114 while (responseBody.read(buffer) != -1) { in interruptReadingResponseBody()
/external/mockwebserver/src/test/java/com/google/mockwebserver/
DMockWebServerTest.java221 InputStream responseBody = new ByteArrayInputStream("ABC".getBytes("UTF-8")); in testStreamingResponseBody() local
222 server.enqueue(new MockResponse().setBody(responseBody, 3)); in testStreamingResponseBody()
230 assertEquals(-1, responseBody.read()); // The body is exhausted. in testStreamingResponseBody()
/external/robolectric/v1/src/main/java/com/xtremelabs/robolectric/
DRobolectric.java1075 …public static void addPendingHttpResponse(int statusCode, String responseBody, Header... headers) { in addPendingHttpResponse() argument
1076 getFakeHttpLayer().addPendingHttpResponse(statusCode, responseBody, headers); in addPendingHttpResponse()
1088 …public static void addPendingHttpResponseWithContentType(int statusCode, String responseBody, Head… in addPendingHttpResponseWithContentType() argument
1089 getFakeHttpLayer().addPendingHttpResponse(statusCode, responseBody, contentType); in addPendingHttpResponseWithContentType()
1204 public static void setDefaultHttpResponse(int statusCode, String responseBody) { in setDefaultHttpResponse() argument
1205 getFakeHttpLayer().setDefaultHttpResponse(statusCode, responseBody); in setDefaultHttpResponse()
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/http/
DHttpEngine.java645 GzipSource responseBody = new GzipSource(response.body().source()); in unzip() local
652 .body(new RealResponseBody(strippedHeaders, Okio.buffer(responseBody))) in unzip()