Permalink
Browse files

Merge pull request #362 from NetForce1/master

make status message available on response
  • Loading branch information...
2 parents 86f12eb + 9b6a5ec commit ad55e225a668facb367956b47d7230fd4d253413 @fernandezpablo85 fernandezpablo85 committed Mar 7, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/main/java/org/scribe/model/Response.java
@@ -17,6 +17,7 @@
private static final String EMPTY = "";
private int code;
+ private String message;
private String body;
private InputStream stream;
private Map<String, String> headers;
@@ -27,6 +28,7 @@
{
connection.connect();
code = connection.getResponseCode();
+ message = connection.getResponseMessage();
headers = parseHeaders(connection);
stream = isSuccessful() ? connection.getInputStream() : connection.getErrorStream();
}
@@ -87,6 +89,17 @@ public int getCode()
{
return code;
}
+
+ /**
+ * Obtains the HTTP status message.
+ * Returns <code>null</code> if the message can not be discerned from the response (not valid HTTP)
+ *
+ * @return the status message
+ */
+ public String getMessage()
+ {
+ return message;
+ }
/**
* Obtains a {@link Map} containing the HTTP Response Headers

1 comment on commit ad55e22

ndotty commented on ad55e22 Mar 14, 2013

men thats cool

Please sign in to comment.