Skip to content

Commit

Permalink
Request headers
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Oct 7, 2024
1 parent 6f0b2da commit 84a29b6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -2506,14 +2506,17 @@ <h4 id="11431-update-related-entities-when-updating-an-entity"><a id="UpdateRela
</div>
<p>If the targeted entity in the payload contains some structural properties, <code>PUT</code> resets all its other structural properties. The following alternative payload resets the first and last names of the new manager. The effect would be the same if the <code>@id</code> was omitted from the request.</p>
<div class="side-by-side">
<div class="sourceCode" id="cb101"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb101-2"><a href="#cb101-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;FirstName&quot;</span><span class="fu">:</span> <span class="st">&quot;Suzanne&quot;</span><span class="fu">,</span></span>
<span id="cb101-3"><a href="#cb101-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;LastName&quot;</span><span class="fu">:</span> <span class="st">&quot;Brown-Johnson&quot;</span><span class="fu">,</span></span>
<span id="cb101-4"><a href="#cb101-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Manager&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb101-5"><a href="#cb101-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@id&quot;</span><span class="fu">:</span> <span class="st">&quot;Employees(6)&quot;</span><span class="fu">,</span></span>
<span id="cb101-6"><a href="#cb101-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;EmployeeID&quot;</span><span class="fu">:</span> <span class="dv">6</span></span>
<span id="cb101-7"><a href="#cb101-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb101-8"><a href="#cb101-8" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<div class="sourceCode" id="cb101"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a><span class="er">PUT</span> <span class="er">http://host/service/Employees(7)?$expand=Manager</span></span>
<span id="cb101-2"><a href="#cb101-2" aria-hidden="true" tabindex="-1"></a><span class="er">Content-Type:</span> <span class="er">application/json</span></span>
<span id="cb101-3"><a href="#cb101-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb101-4"><a href="#cb101-4" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb101-5"><a href="#cb101-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;FirstName&quot;</span><span class="fu">:</span> <span class="st">&quot;Suzanne&quot;</span><span class="fu">,</span></span>
<span id="cb101-6"><a href="#cb101-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;LastName&quot;</span><span class="fu">:</span> <span class="st">&quot;Brown-Johnson&quot;</span><span class="fu">,</span></span>
<span id="cb101-7"><a href="#cb101-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Manager&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb101-8"><a href="#cb101-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@id&quot;</span><span class="fu">:</span> <span class="st">&quot;Employees(6)&quot;</span><span class="fu">,</span></span>
<span id="cb101-9"><a href="#cb101-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;EmployeeID&quot;</span><span class="fu">:</span> <span class="dv">6</span></span>
<span id="cb101-10"><a href="#cb101-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb101-11"><a href="#cb101-11" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<div class="sourceCode" id="cb102"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb102-1"><a href="#cb102-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb102-2"><a href="#cb102-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@context&quot;</span><span class="fu">:</span> <span class="st">&quot;$metadata#Employees/$entity&quot;</span><span class="fu">,</span></span>
<span id="cb102-3"><a href="#cb102-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;EmployeeID&quot;</span><span class="fu">:</span> <span class="dv">7</span><span class="fu">,</span></span>
Expand Down
3 changes: 3 additions & 0 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -4599,6 +4599,9 @@ payload resets the first and last names of the new manager.
The effect would be the same if the `@id` was omitted from the request.
:::: side-by-side
```json
PUT http://host/service/Employees(7)?$expand=Manager
Content-Type: application/json

{
"FirstName": "Suzanne",
"LastName": "Brown-Johnson",
Expand Down
3 changes: 3 additions & 0 deletions odata-protocol/11.4 Data Modification.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ payload resets the first and last names of the new manager.
The effect would be the same if the `@id` was omitted from the request.
:::: side-by-side
```json
PUT http://host/service/Employees(7)?$expand=Manager
Content-Type: application/json

{
"FirstName": "Suzanne",
"LastName": "Brown-Johnson",
Expand Down

0 comments on commit 84a29b6

Please sign in to comment.