hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hentschel (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-17713) the interface '/version/cluster' with header 'Accept: application/json' return is not JSON but plain text
Date Fri, 03 Mar 2017 15:04:45 GMT

    [ https://issues.apache.org/jira/browse/HBASE-17713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894516#comment-15894516
] 

Jan Hentschel commented on HBASE-17713:
---------------------------------------

If I understand the JSON specification correctly, a String literal as above is valid JSON.
It does not need to be specified in object notation. Have a look at the following references

* http://stackoverflow.com/questions/13318420/is-a-single-string-value-considered-valid-json
* http://www.freeformatter.com/json-validator.html

The appropriate test in the codebase of HBase (TestVersionResource#doTestGetStorageClusterVersionJSON)
shows that JSON is returned as the content type.

> the interface '/version/cluster' with header 'Accept: application/json' return is not
JSON but plain text
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-17713
>                 URL: https://issues.apache.org/jira/browse/HBASE-17713
>             Project: HBase
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 1.2.2
>         Environment: Hhbase 1.2.2
>            Reporter: Feng Ce
>            Priority: Minor
>   Original Estimate: 6h
>  Remaining Estimate: 6h
>
> Hbase REST API, this interface `get 'version/cluster'`, when I use the header `Accept:
application/json`, the response is not JSON but plain text.
> {code:none}
>     curl -X GET \
>       -H "Accept: application/json" \
>       "http://localhost:8888/version/cluster"
>    "1.2.2"
> {code}
> But when I use `Accept: text/xml`, the response is correct XML.
> {code:none}
>     curl -X GET \
>       -H "Accept: text/xml" \
>       "http://localhost:8888/version/cluster"
>      <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ClusterVersion>1.2.2</ClusterVersion>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message