Best code examples for Android BasicHttpResponse class (org.apache.http.message.BasicHttpResponse)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BasicHttpResponse class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android BasicHttpResponse examples from Open Source projects
This code example shows how to use the following methods: addHeader
212:	final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
213:	response.addHeader(HTTP.CONTENT_LEN, "10"); 
214:	response.addHeader(HTTP.CONTENT_TYPE, "stuff"); 
215:	response.addHeader(HTTP.CONTENT_ENCODING, "identity"); 
-
218:	final HttpEntity entity = conn.prepareDecoder(response); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEntity
60:	HttpResponse response = new BasicHttpResponse(statusLine); 
61:	response.setEntity(mResponseEntity); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: equals, setEntity
34:	HttpResponse httpResponse = new BasicHttpResponse(new BasicStatusLine( 
-
39:	httpResponse.setEntity(inputStreamEntity); 
-
43:	APIClientResponse<APIScheduleResponse> response = 
-
48:	httpResponse.equals(httpResponse)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getStatusLine
86:	final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
87:	Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_1, 200, context)).thenReturn(response); 
88:	Mockito.when(connReuseStrategy.keepAlive(response, context)).thenReturn(Boolean.FALSE); 
-
92:	Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode()); 
-
96:	Assert.assertSame(response, context.getResponse()); 
-
99:	Mockito.verify(httprocessor).process(response, context); 
100:	Mockito.verify(conn).sendResponseHeader(response); 
101:	Mockito.verify(conn).sendResponseEntity(response); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
69:	200, "OK")); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setHeader, setEntity
79:	HttpResponse httpResponse = new BasicHttpResponse(new BasicStatusLine( 
-
84:	httpResponse.setEntity(inputStreamEntity); 
85:	httpResponse.setHeader(new BasicHeader(CONTENT_TYPE_KEY, UA_JSON_RESPONSE)); 
-
90:	handler.handleResponse(httpResponse); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addHeader, removeHeaders
22:	BasicHttpResponse msg = new BasicHttpResponse(new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "")); 
-
25:	msg.addHeader(header1); 
26:	msg.addHeader(header2); 
-
28:	assertTrue(HttpCoreUtils.hasHeaderListValue(msg, "key", "value1")); 
29:	assertTrue(HttpCoreUtils.hasHeaderListValue(msg, "key", "value2")); 
30:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "key", "value3")); 
31:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "key1", "value1")); 
32:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "", "")); 
-
34:	msg.removeHeaders("key"); 
35:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "key", "value1")); 
36:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "key", "value2")); 
37:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "key1", "value1")); 
38:	assertFalse(HttpCoreUtils.hasHeaderListValue(msg, "key1", "value2")); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
16:	HttpResponse httpResponse = new BasicHttpResponse(new BasicStatusLine( 
-
32:	.setHttpResponse(httpResponse) 
-
36:	testException.getHttpResponse().equals(httpResponse)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
19:	HttpResponse httpResponse = new BasicHttpResponse(new BasicStatusLine( 
-
25:	APIClientResponse.Builder<APIScheduleResponse> builder = 
-
31:	testResponse.getHttpResponse().equals(httpResponse)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addHeader
80:	final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
81:	response.addHeader("Transfer-Encoding", "chunked"); 
82:	Assert.assertTrue(reuseStrategy.keepAlive(response, context)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getFirstHeader, setHeader, setStatusCode
17:	BasicHttpResponse response = new BasicHttpResponse( 
-
19:	control.process(response, new BasicHttpContext(null)); 
20:	assertNull(response.getFirstHeader(HTTP.CONN_DIRECTIVE)); 
-
22:	response.setStatusCode(HttpStatus.SC_BAD_REQUEST); 
23:	control.process(response, new BasicHttpContext(null)); 
24:	Header header = response.getFirstHeader(HTTP.CONN_DIRECTIVE); 
-
30:	response.setStatusCode(HttpStatus.SC_BAD_REQUEST); 
31:	response.setHeader(HTTP.CONN_DIRECTIVE, "Keep-Alive"); 
32:	control.process(response, new BasicHttpContext(null)); 
33:	header = response.getFirstHeader(HTTP.CONN_DIRECTIVE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
351:	final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
-
353:	Mockito.when(reuseStrategy.keepAlive(response, this.context)).thenReturn(Boolean.FALSE); 
-
355:	this.exchangeHandler.responseReceived(response); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getEntity, setEntity
59:	HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
-
61:	response.setEntity(original); 
-
65:	interceptor.process(response, context); 
66:	HttpEntity entity = response.getEntity(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addHeader
173:	final HttpResponse message = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
174:	message.addHeader("Content-Length", "10"); 
175:	message.addHeader("Content-Type", "stuff"); 
176:	message.addHeader("Content-Encoding", "identity"); 
177:	final HttpEntity entity = conn.prepareInput(message); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getEntity, getStatusLine
68:	response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 
-
70:	handler.handle(request, response, null); 
71:	assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); 
72:	assertEquals(indexFile, ((FileNIOEntity) response.getEntity()) 
-
74:	assertEquals("text/html", response.getEntity().getContentType().getValue()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addHeader
135:	final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); 
136:	response.addHeader("User-Agent", "test"); 
-
138:	conn.sendResponseHeader(response); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addHeader, getFirstHeader, getParams
829:	HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"); 
830:	response.getParams().setParameter(CoreProtocolPNames.ORIGIN_SERVER, "some server"); 
831:	response.addHeader(new BasicHeader(HTTP.SERVER_HEADER, "whatever")); 
-
834:	Header h1 = response.getFirstHeader(HTTP.SERVER_HEADER); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHeader, setEntity
330:	HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"); 
331:	response.setHeader("Content-MD5","a checksum"); 
332:	response.setEntity(new ByteArrayEntity(plainText.getBytes())); 
333:	backend.setResponse(response); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addHeader
67:	HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 
-
69:	response.addHeader("Location", "http://localhost/stuff"); 
70:	Assert.assertTrue(redirectStrategy.isRedirected(httpget, response, context)); 
-
72:	Assert.assertFalse(redirectStrategy.isRedirected(httppost, response, context)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setReasonPhrase
234:	BasicHttpResponse errorResponse = new BasicHttpResponse(new ProtocolVersion("HTTP_ERROR", 1, 1), 500, "ERROR"); 
-
241:	errorResponse.setReasonPhrase(e.getMessage()); 
-
243:	this.responseHandler.handleResponse(errorResponse); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHeader, setEntity
98:	HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_PARTIAL_CONTENT, "Partial Content"); 
-
101:	resp.setEntity(new ByteArrayEntity(bytes)); 
102:	resp.setHeader("Content-Length","128"); 
103:	resp.setHeader("Content-Range","bytes 0-127/255"); 
-
105:	assertFalse(impl.isIncompleteResponse(resp, resource)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getStatusLine
32:	new BasicHttpResponse(new ProtocolVersion("HTTP", 1, 1), 
-
35:	respond.respond(response); 
-
37:	assertEquals("!404", HttpStatus.SC_NOT_FOUND, response.getStatusLine() 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHeaders, setEntity
118:	HttpResponse reconstructed = new BasicHttpResponse(response.getStatusLine()); 
119:	reconstructed.setHeaders(response.getAllHeaders()); 
-
128:	reconstructed.setEntity(combinedEntity); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addHeader, setEntity
190:	BasicHttpResponse resp = new BasicHttpResponse( 
-
192:	resp.addHeader("Content-Type", "application/json; charset=utf-8"); 
-
218:	resp.setEntity(new StringEntity(jsonString, "utf-8")); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setReasonPhrase
233:	BasicHttpResponse errorResponse = new BasicHttpResponse(new ProtocolVersion("HTTP_ERROR", 1, 1), 500, "ERROR"); 
-
240:	errorResponse.setReasonPhrase(e.getMessage()); 
-
242:	this.responseHandler.handleResponse(errorResponse); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setReasonPhrase
246:	BasicHttpResponse errorResponse = new BasicHttpResponse( 
-
257:	errorResponse.setReasonPhrase(e.getMessage()); 
-
259:	this.responseHandler.handleResponse(errorResponse); 
Full Snippet Info
5
CodeRank
Related Android BasicHttpResponse Questions & Answers:
See Code Examples for Android BasicHttpResponse Methods: