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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/urlconnection/CronetHttpURLConnection.java

Issue 1490203003: [Cronet] Set HTTP method before starting a request in CronetHttpURLConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetHttpURLConnectionTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.net.urlconnection; 5 package org.chromium.net.urlconnection;
6 6
7 import android.util.Pair; 7 import android.util.Pair;
8 8
9 import org.chromium.base.Log; 9 import org.chromium.base.Log;
10 import org.chromium.net.CronetEngine; 10 import org.chromium.net.CronetEngine;
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 addRequestProperty("Content-Type", 275 addRequestProperty("Content-Type",
276 "application/x-www-form-urlencoded"); 276 "application/x-www-form-urlencoded");
277 } 277 }
278 } 278 }
279 for (Pair<String, String> requestHeader : mRequestHeaders) { 279 for (Pair<String, String> requestHeader : mRequestHeaders) {
280 requestBuilder.addHeader(requestHeader.first, requestHeader.second); 280 requestBuilder.addHeader(requestHeader.first, requestHeader.second);
281 } 281 }
282 if (!getUseCaches()) { 282 if (!getUseCaches()) {
283 requestBuilder.disableCache(); 283 requestBuilder.disableCache();
284 } 284 }
285 // Set HTTP method.
286 requestBuilder.setHttpMethod(method);
287
285 connected = true; 288 connected = true;
286 mRequest = requestBuilder.build(); 289 mRequest = requestBuilder.build();
287 // Start the request. 290 // Start the request.
288 mRequest.start(); 291 mRequest.start();
289 } 292 }
290 293
291 /** 294 /**
292 * Returns an input stream from the server in the case of an error such as 295 * Returns an input stream from the server in the case of an error such as
293 * the requested file has not been found on the remote server. 296 * the requested file has not been found on the remote server.
294 */ 297 */
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 544 }
542 545
543 /** 546 /**
544 * Returns whether the client has used {@link #setChunkedStreamingMode} to 547 * Returns whether the client has used {@link #setChunkedStreamingMode} to
545 * set chunked encoding for upload. 548 * set chunked encoding for upload.
546 */ 549 */
547 private boolean isChunkedUpload() { 550 private boolean isChunkedUpload() {
548 return chunkLength > 0; 551 return chunkLength > 0;
549 } 552 }
550 } 553 }
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetHttpURLConnectionTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698