...
Code Block | ||
---|---|---|
| ||
HTTP/1.1 200 OK Accept-Patch: application/vnd.ez.api.ContentUpdate+xml;charset=utf8 Content-Type: application/vnd.ez.api.ContentInfo+xml Content-Length: xxx |
Those headers give us information:
We can learn three things from those response headers:
- The length of our content. It doesn't really matter that much...
- What we are receiving, here, a ContentInfo (
Content-Type: application/vnd.ez.api.ContentInfo
) in XML (Content-Type: application/vnd.ez.api.ContentInfo+xml
) - We can modify the received content by patching (
Accept-Patch: application/vnd.ez.api.ContentUpdate+xml;charset=utf8
) it with a ContentUpdate (Accept-Patch: application/vnd.ez.api.ContentUpdate+xml;charset=utf8
) in XML (Accept-Patch: application/vnd.ez.api.ContentUpdate+xml;charset=utf8
)
This last part means that if we send a PATCH /content/objects/23 request with a ContentUpdate XML payload, we will update this Content.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?> <Content href="/content/objects/23" id="23" media-type="application/vnd.ez.api.Content+xml" remoteId="qwert123"> <ContentType href="/content/types/10" media-type="application/vnd.ez.api.ContentType+xml" /> <Name>This is a title</Name> <Versions href="/content/objects/23/versions" media-type="application/vnd.ez.api.VersionList+xml" /> <CurrentVersion href="/content/objects/23/currentversion" media-type="application/vnd.ez.api.Version+xml"/> <Section href="/content/sections/4" media-type="application/vnd.ez.api.Section+xml" /> <MainLocation href="/content/locations/1/4/65" media-type="application/vnd.ez.api.Location+xml" /> <Locations href="/content/objects/23/locations" media-type="application/vnd.ez.api.LocationList+xml" /> <Owner href="/user/users/14" media-type="application/vnd.ez.api.User+xml" /> <lastModificationDate>2012-02-12T12:30:00</lastModificationDate> <publishedDate>2012-02-12T15:30:00</publishedDate> <mainLanguageCode>eng-US</mainLanguageCode> <alwaysAvailable>true</alwaysAvailable> </Content> |
The XML body is a serialized version of a ContentInfo struct.