Package com.twilio.http
Class Response
- java.lang.Object
-
- com.twilio.http.Response
-
public class Response extends Object
-
-
Constructor Summary
Constructors Constructor Description Response(InputStream stream, int statusCode)Create a Response from input stream and status code.Response(InputStream stream, int statusCode, org.apache.http.Header[] headers)Create a Response from input stream, status code, and headers.Response(String content, int statusCode)Create a Response from content string and status code.Response(String content, int statusCode, org.apache.http.Header[] headers)Create a Response from content string, status code, and headers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContent()Get the the content of the response.org.apache.http.Header[]getHeaders()intgetStatusCode()InputStreamgetStream()Get response data as stream.
-
-
-
Constructor Detail
-
Response
public Response(String content, int statusCode)
Create a Response from content string and status code.- Parameters:
content- content stringstatusCode- status code
-
Response
public Response(String content, int statusCode, org.apache.http.Header[] headers)
Create a Response from content string, status code, and headers.- Parameters:
content- content stringstatusCode- status codeheaders- headers
-
Response
public Response(InputStream stream, int statusCode)
Create a Response from input stream and status code.- Parameters:
stream- input streamstatusCode- status code
-
Response
public Response(InputStream stream, int statusCode, org.apache.http.Header[] headers)
Create a Response from input stream, status code, and headers.- Parameters:
stream- input streamstatusCode- status codeheaders- headers
-
-
Method Detail
-
getContent
public String getContent()
Get the the content of the response.If there is a content string, that will be returned. Otherwise, will get content from input stream
- Returns:
- the content string
-
getStream
public InputStream getStream()
Get response data as stream.- Returns:
- the response data as a stream
-
getStatusCode
public int getStatusCode()
-
getHeaders
public org.apache.http.Header[] getHeaders()
-
-