File tree Expand file tree Collapse file tree
src/main/java/org/scribe/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public class Response
1717 private static final String EMPTY = "" ;
1818
1919 private int code ;
20+ private String message ;
2021 private String body ;
2122 private InputStream stream ;
2223 private Map <String , String > headers ;
@@ -27,6 +28,7 @@ public class Response
2728 {
2829 connection .connect ();
2930 code = connection .getResponseCode ();
31+ message = connection .getResponseMessage ();
3032 headers = parseHeaders (connection );
3133 stream = isSuccessful () ? connection .getInputStream () : connection .getErrorStream ();
3234 }
@@ -87,6 +89,17 @@ public int getCode()
8789 {
8890 return code ;
8991 }
92+
93+ /**
94+ * Obtains the HTTP status message.
95+ * Returns <code>null</code> if the message can not be discerned from the response (not valid HTTP)
96+ *
97+ * @return the status message
98+ */
99+ public String getMessage ()
100+ {
101+ return message ;
102+ }
90103
91104 /**
92105 * Obtains a {@link Map} containing the HTTP Response Headers
You can’t perform that action at this time.
0 commit comments