| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |