1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:exsl="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng"><head>
5
<meta http-equiv="X-UA-Compatible" content="IE=7"/>
6
<title>3.1. Request/Response Types</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><link rel="home" href="index.html" title="Keystone Developer Guide"/><link rel="up" href="General_API_Information-d1e141.html" title="Chapter 3. General API Information"/><link rel="prev" href="General_API_Information-d1e141.html" title="Chapter 3. General API Information"/><link rel="next" href="Content_Compression-d1e262.html" title="3.2. Content Compression"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript">
7
//The id for tree cookie
8
var treeCookieId = "treeview-1003";
12
txt_filesfound = 'Results';
13
txt_enter_at_least_1_char = "You must enter at least one character.";
14
txt_browser_not_supported = "Your browser is not supported. Use of Mozilla Firefox is recommended.";
15
txt_please_wait = "Please wait. Search in progress...";
16
txt_results_for = "Results for: ";
17
</script><style type="text/css">
27
background: transparent url(../common/jquery/treeview/images/folder.gif) 0 0px no-repeat;
30
</style><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/><link rel="stylesheet" type="text/css" href="../common/css/positioning.css"/><!--[if IE]>
31
<link rel="stylesheet" type="text/css" href="../common/css/ie.css"/>
32
<![endif]--><link rel="stylesheet" type="text/css" href="../common/jquery/theme-redmond/jquery-ui-1.8.2.custom.css"/><link rel="stylesheet" type="text/css" href="../common/jquery/treeview/jquery.treeview.css"/><script type="text/javascript" src="../common/jquery/jquery-1.4.2.min.js"><!----></script><script type="text/javascript" src="../common/jquery/jquery-ui-1.8.2.custom.min.js"><!----></script><script type="text/javascript" src="../common/jquery/jquery.cookie.js"><!----></script><script type="text/javascript" src="../common/jquery/treeview/jquery.treeview.min.js"><!----></script><script type="text/javascript" src="search/htmlFileList.js"><!----></script><script type="text/javascript" src="search/htmlFileInfoList.js"><!----></script><script type="text/javascript" src="search/nwSearchFnt.js"><!----></script><script type="text/javascript" src="search/stemmers/en_stemmer.js"><!--//make this scalable to other languages as well.--></script><script type="text/javascript" src="search/index-1.js"><!----></script><script type="text/javascript" src="search/index-2.js"><!----></script><script type="text/javascript" src="search/index-3.js"><!----></script><script type="text/javascript">
33
var _gaq = _gaq || [];
34
_gaq.push(['_setAccount', 'UA-17511903-6']);
35
</script><script type="text/javascript" src="../common/ga.js"><!----></script></head><body><div id="header"><a onclick="_gaq.push(['_trackEvent', 'Header', 'logo', 'click', 1]);" target="_blank" href="http://www.openstack.org"><img src="../common/images/openstack-logo.png" alt="OpenStack Documentation" width="157" height="47"/></a><p class="breadcrumbs"><a href="http://docs.openstack.org/">OpenStack Manuals</a><a href="index.html">Keystone Developer Guide
36
- API v2.0</a></p><h1>3.1. Request/Response Types</h1><div id="navheader" align="right"><!----><table class="navLinks"><tr><td><a id="showHideButton" onclick="showHideToc(); _gaq.push(['_trackEvent', 'Header', 'show/hide', 'click', 1]);" class="pointLeft" title="Hide TOC tree">Sidebar
37
</a></td><td><a accesskey="p" class="navLinkPrevious" onclick="_gaq.push(['_trackEvent', 'Header', 'prevLink', 'click', 1]);" tabindex="5" href="General_API_Information-d1e141.html">Prev</a>
39
<a accesskey="u" class="navLinkUp" onclick="_gaq.push(['_trackEvent', 'Header', 'upLink', 'click', 1]);" tabindex="5" href="General_API_Information-d1e141.html">Up</a>
41
<a accesskey="n" class="navLinkNext" onclick="_gaq.push(['_trackEvent', 'Header', 'nextLink', 'click', 1]);" tabindex="5" href="Content_Compression-d1e262.html">Next</a></td></tr></table></div></div><div id="content"><div class="statustext">DRAFT - DRAFT - DRAFT - DRAFT - DRAFT - DRAFT - </div><div class="section" title="3.1. Request/Response Types"><div xmlns="" class="titlepage"><div><div><h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a id="Request_Response_Types-d1e149"/>3.1. Request/Response Types</h2></div></div></div><p> The Keystone API supports both the JSON and XML data serialization formats. The request
42
format is specified using the <code class="code">Content-Type</code> header and is required for
43
operations that have a request body. The response format can be specified in requests using
44
either the <code class="code">Accept</code> header or adding an <code class="code">.xml</code> or <code class="code">.json</code>
45
extension to the request URI. Note that it is possible for a response to be serialized using
46
a format different from the request (see example below). If no response format is specified,
47
JSON is the default. If conflicting formats are specified using both an <code class="code">Accept</code>
48
header and a query extension, the query extension takes precedence.</p><table rules="all" id="d142e61"><caption>Table 3.1. Response Types</caption><thead><tr>
50
<td>Accept Header</td>
51
<td>Query Extension</td>
53
</tr></thead><tbody><tr>
55
<td>application/json</td>
60
<td>application/xml</td>
63
</tr></tbody></table><div class="example"><a id="d142e80"/><p class="title"><strong>Example 3.1. JSON Request with Headers</strong></p><div class="example-contents"><pre class="programlisting">
64
POST /v2.0/tokens HTTP/1.1
65
Host: identity.api.openstack.org
66
Content-Type: application/json
67
Accept: application/xml
68
</pre><pre class="programlisting">
69
<?xml version="1.0" encoding="UTF-8"?>
70
<passwordCredentials
71
xmlns="http://docs.openstack.org/identity/api/v2.0"
75
</pre></div></div><br class="example-break"/><div class="example"><a id="d142e84"/><p class="title"><strong>Example 3.2. XML Response with Headers</strong></p><div class="example-contents"><pre class="programlisting">
77
Date: Mon, 12 Nov 2010 15:55:01 GMT
79
Content-Type: application/xml; charset=UTF-8
80
</pre><pre class="programlisting">
81
<?xml version="1.0" encoding="UTF-8"?>
82
<auth xmlns="http://docs.openstack.org/identity/api/v2.0">
83
<token expires="2010-11-01T03:32:15-05:00"
84
id="ab48a9efdfedb23ty3494"/>
85
<serviceCatalog>
86
<service type="compute" name="Computers in the Cloud">
89
publicURL="https://north.compute.public.com/v2.0/account1"
90
internalURL="https://north.compute.internal.com/v2.0/account1">
93
info="https://north.compute.public.com/v2.0/"
94
list="https://north.compute.public.com/" />
98
publicURL="https://south.compute.public.com/v2.0/account1"
99
internalURL="https://south.compute.internal.com/v2.0/account1">
102
info="https://south.compute.public.com/v2.0/"
103
list="https://south.compute.public.com/" />
106
<service type="object-store" name="HTTP Object Store">
109
publicURL="https://north.object-store.public.com/v1/account1"
110
internalURL="https://north.object-store.internal.com/v1/account1">
113
info="https://north.object-store.public.com/v1/"
114
list="https://north.object-store.public.com/" />
118
publicURL="https://south.object-store.public.com/v2.0/account1"
119
internalURL="https://south.object-store.internal.com/v2.0/account1">
122
info="https://south.object-store.public.com/v1/"
123
list="https://south.object-store.public.com/" />
126
<service type="dns" name="DNS-as-a-Service">
128
publicURL="https://dns.public.com/v2.0/blah-blah">
131
info="https://dns.public.com/v2.0/"
132
list="https://dns.public.com/" />
135
</serviceCatalog>
138
</pre></div></div><br class="example-break"/></div><script type="text/javascript" src="../common/main.js"><!----></script><hr/><div id="disqus_thread"><script type="text/javascript">
139
var disqus_shortname = 'os-identitydevguide';
140
</script><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript><script type="text/javascript" src="../common/comments.js"><!----></script></div><hr/><div class="legal"><a href="index.html">Legal notices</a></div></div><div><div id="leftnavigation" style="padding-top:3px; background-color:white;"><div id="tabs"><ul><li><a href="#treeDiv" tabindex="1"><span class="contentsTab">Contents</span></a></li><li><a href="#searchDiv" tabindex="1"><span class="searchTab">Search</span></a></li></ul><div id="treeDiv"><img src="../common/images/loading.gif" alt="loading table of contents..." id="tocLoading" style="display:block;"/><div id="ulTreeDiv" style="display:none" class="thisisthat"><ul id="tree" class="filetree"><li tabindex="2"><span class="file"><a href="Overview-d1e62.html">1. Overview</a></span></li><li tabindex="2"><span class="file"><a href="Concepts-d1e74.html">2. Concepts</a></span><ul><li tabindex="2"><span class="file"><a href="Token-d1e82.html">2.1. Token</a></span></li><li tabindex="2"><span class="file"><a href="Tenant-d1e94.html">2.2. Tenant</a></span></li><li tabindex="2"><span class="file"><a href="User-d1e103.html">2.3. User</a></span></li><li tabindex="2"><span class="file"><a href="Service-d1e104.html">2.4. Service</a></span></li><li tabindex="2"><span class="file"><a href="Endpoint-d1e122.html">2.5. Endpoint</a></span></li><li tabindex="2"><span class="file"><a href="Role-d1e131.html">2.6. Role</a></span></li></ul></li><li tabindex="2"><span class="file"><a href="General_API_Information-d1e141.html">3. General API Information</a></span><ul><li tabindex="2" id="webhelp-currentid"><span class="file"><a href="Request_Response_Types-d1e149.html">3.1. Request/Response Types</a></span></li><li tabindex="2"><span class="file"><a href="Content_Compression-d1e262.html">3.2. Content Compression</a></span></li><li tabindex="2"><span class="file"><a href="Paginated_Collections-d1e325.html">3.3. Paginated Collections</a></span></li><li tabindex="2"><span class="file"><a href="Versions-d1e472.html">3.4. Versions</a></span></li><li tabindex="2"><span class="file"><a href="Extensions-d1e688.html">3.5. Extensions</a></span></li><li tabindex="2"><span class="file"><a href="Faults-d1e908.html">3.6. Faults</a></span></li></ul></li><li tabindex="2"><span class="file"><a href="Service_API_Client_Operations_-d1e1110.html">4. Service API (Client Operations)</a></span><ul><li tabindex="2"><span class="file"><a href="Overview-d1e1115.html">4.1. Overview</a></span></li><li tabindex="2"><span class="file"><a href="Core_Service_API_Proposal-d1e1124.html">4.2. Core Service API Proposal</a></span></li><li tabindex="2"><span class="file"><a href="Authenticate-d1e1166.html">4.3. Authenticate</a></span></li><li tabindex="2"><span class="file"><a href="Get_Tenants-d1e1264.html">4.4. Get Tenants</a></span></li></ul></li></ul></div></div><div id="searchDiv"><div id="search"><form onsubmit="Verifie(ditaSearch_Form);return false" name="ditaSearch_Form" class="searchForm"><fieldset class="searchFieldSet"><legend>Search</legend><center><input id="textToSearch" name="textToSearch" type="text" class="searchText"/> <input onclick="Verifie(ditaSearch_Form)" type="button" class="searchButton" value="Go" id="doSearch"/></center></fieldset></form></div><div id="searchResults"><center/></div><p class="searchHighlight"><a href="#" onclick="toggleHighlight()">Search Highlighter (On/Off)</a></p></div></div></div></div></body></html>
b'\\ No newline at end of file'