cTag format is different in response headers when fetching the file contents

Ivan Maria 86 Reputation points
2021-06-18T09:18:26.097+00:00

When I use the following API

GET /drives/{drive-id}/items/{item-id}

I get the following ctag value in the response body

"c:{21087D96-34CA-416F-8613-F8ED59C6DB34},5"

The above ctag works well with If-Match header for subsequent requests.

However, when I use the following API

GET /drives/{drive-id}/items/{item-id}/content

I get the following ctag value in response header.

{21087D96-34CA-416F-8613-F8ED59C6DB34},6,5

As the format of above ctag is different, it always fail for If-Match header in subsequent requests.

What is the recommended way of handling the ctag value correctly?

Windows development | Windows API - Win32

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.