[jbosstools-issues] [JBoss JIRA] (JBIDE-11603) Support REST API version negotiation
Andre Dietisheim (JIRA)
jira-events at lists.jboss.org
Mon Apr 23 03:20:18 EDT 2012
Andre Dietisheim created JBIDE-11603:
----------------------------------------
Summary: Support REST API version negotiation
Key: JBIDE-11603
URL: https://issues.jboss.org/browse/JBIDE-11603
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: openshift
Affects Versions: 3.3.0.Beta3
Reporter: Andre Dietisheim
Assignee: Andre Dietisheim
Fix For: 3.3.0.Beta3
The latest REST api supports version negotiation:
The client may indicate what service (protocol) version he'd like to use and the service would then use this version to talk to the client:
Mail by Lili Nader on the 4.21.2012
{quote}
The rest api will return the latest version unless a version is explicitly requested by specifying it in HTTP Accept header in this format "Accept: application/xml; version=1.0"
For example:
curl -i -k https://localhost/broker/rest/api -H "Accept: application/xml; version=1.0"
The api also returns a list of supported versions (right now the only supported version is 1.0):
<?xml version="1.0" encoding="UTF-8"?>
<response>
<version>2.0</version>
<supported-api-versions>
<supported-api-version>1.0</supported-api-version>
</supported-api-versions>
</response>
If the version requested in not supported then it will return a HTTP Status 406 and an error message as shown below.
For example:
curl -i -k https://localhost/broker/rest/api -H "Accept: application/xml; version=2.2"
HTTP/1.1 406 Not Acceptable
<?xml version="1.0" encoding="UTF-8"?>
<response>
<version>1.0</version>
<messages>
<message>
<field nil="true"></field>
<text>Requested API version 2.2 is not supported. Supported versions are 1.0</text>
<exit-code/>
<severity>error</severity>
</message>
</messages>
<status>not_acceptable</status>
<supported-api-versions>
<supported-api-version>1.0</supported-api-version>
</supported-api-versions>
</response>
{quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list