From fa4f6389426c55abf8a1f0d1791deacdc181748c Mon Sep 17 00:00:00 2001 From: Niels Basjes Date: Wed, 26 Apr 2017 11:21:39 +0200 Subject: [PATCH] HBASE-17962 Improve documentation on Rest interface (Excluded update to the ref guide, since it'll be copied from master branch prior to 1.4 release.) Signed-off-by: Sean Busbey --- .../java/org/apache/hadoop/hbase/rest/RowResource.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java index 4d50c54f30e..d93fd39a379 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java @@ -139,7 +139,13 @@ public class RowResource extends ResourceBase { if (!rowspec.hasColumns() || rowspec.getColumns().length > 1) { servlet.getMetrics().incrementFailedGetRequests(1); return Response.status(Response.Status.BAD_REQUEST).type(MIMETYPE_TEXT) - .entity("Bad request: Either 0 or more than 1 columns specified." + CRLF).build(); + .entity("Bad request: Default 'GET' method only works if there is exactly 1 column " + + "in the row. Using the 'Accept' header with one of these formats lets you " + + "retrieve the entire row if it has multiple columns: " + + // Same as the @Produces list for the get method. + MIMETYPE_XML + ", " + MIMETYPE_JSON + ", " + + MIMETYPE_PROTOBUF + ", " + MIMETYPE_PROTOBUF_IETF + + CRLF).build(); } MultivaluedMap params = uriInfo.getQueryParameters(); try {