Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: content/common/net/url_fetcher_impl.cc

Issue 9342007: Add HTTP PUT request type to content:URLFetcher (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/net/url_fetcher_impl.cc
===================================================================
--- content/common/net/url_fetcher_impl.cc (revision 120612)
+++ content/common/net/url_fetcher_impl.cc (working copy)
@@ -818,6 +818,17 @@
request_->set_method("DELETE");
break;
+ case PUT:
wtc 2012/02/06 23:34:07 Let's list the PUT case right below the POST case
kuan 2012/02/06 23:58:17 Done.
+ DCHECK(!upload_content_.empty());
wtc 2012/02/06 23:34:07 I studied the Section 9.6 PUT in the HTTP 1.1 RFC
kuan 2012/02/06 23:58:17 Done. Since chunked encoding is also allowed for
+ DCHECK(!upload_content_type_.empty());
+
+ request_->set_method("PUT");
+ extra_request_headers_.SetHeader(net::HttpRequestHeaders::kContentType,
+ upload_content_type_);
+ request_->AppendBytesToUpload(
+ upload_content_.data(), static_cast<int>(upload_content_.length()));
+ break;
+
default:
NOTREACHED();
}
@@ -975,6 +986,11 @@
core_->extra_request_headers_.AddHeadersFromString(extra_request_headers);
}
+void URLFetcherImpl::AddRequestHeaderFromString(
+ const base::StringPiece& header_line) {
+ core_->extra_request_headers_.AddHeaderFromString(header_line);
+}
+
void URLFetcherImpl::GetExtraRequestHeaders(net::HttpRequestHeaders* headers) {
headers->CopyFrom(core_->extra_request_headers_);
}

Powered by Google App Engine
This is Rietveld 408576698