1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "google_apis/drive/request_util.h"
8 #include "base/values.h"
10 namespace google_apis
{
15 // etag matching header.
16 const char kIfMatchHeaderPrefix
[] = "If-Match: ";
17 const char kParentLinkKind
[] = "drive#fileLink";
21 const char kIfMatchAllHeader
[] = "If-Match: *";
22 const char kContentTypeApplicationJson
[] = "application/json";
24 std::string
GenerateIfMatchHeader(const std::string
& etag
) {
25 return etag
.empty() ? kIfMatchAllHeader
: (kIfMatchHeaderPrefix
+ etag
);
28 scoped_ptr
<base::DictionaryValue
> CreateParentValue(
29 const std::string
& file_id
) {
30 scoped_ptr
<base::DictionaryValue
> parent(new base::DictionaryValue
);
31 parent
->SetString("kind", kParentLinkKind
);
32 parent
->SetString("id", file_id
);
37 } // namespace google_apis