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; | 5 package org.chromium.net; |
6 | 6 |
7 import java.io.IOException; | 7 import java.io.IOException; |
8 import java.nio.ByteBuffer; | 8 import java.nio.ByteBuffer; |
9 import java.nio.channels.ReadableByteChannel; | 9 import java.nio.channels.ReadableByteChannel; |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 * @param contentType MIME type of the post content or null if this is not a | 64 * @param contentType MIME type of the post content or null if this is not a |
65 * POST. | 65 * POST. |
66 * @param channel The channel to read to read upload data from if this is a | 66 * @param channel The channel to read to read upload data from if this is a |
67 * POST request. | 67 * POST request. |
68 * @param contentLength The length of data to upload. | 68 * @param contentLength The length of data to upload. |
69 */ | 69 */ |
70 void setUploadChannel(String contentType, ReadableByteChannel channel, | 70 void setUploadChannel(String contentType, ReadableByteChannel channel, |
71 long contentLength); | 71 long contentLength); |
72 | 72 |
73 /** | 73 /** |
| 74 * Sets the HTTP method verb to use for this request. Currently can only be |
| 75 * "POST" or "PUT". |
| 76 * |
| 77 * <p>The default when this method is not called is "GET" if the request has |
| 78 * no body or "POST" if it does. |
| 79 * |
| 80 * @param method Either "POST" or "PUT". |
| 81 */ |
| 82 void setHttpMethod(String method); |
| 83 |
| 84 /** |
74 * Start executing the request. | 85 * Start executing the request. |
75 * <p> | 86 * <p> |
76 * If this is a streaming upload request using a ReadableByteChannel, the | 87 * If this is a streaming upload request using a ReadableByteChannel, the |
77 * call will block while the request is uploaded. | 88 * call will block while the request is uploaded. |
78 */ | 89 */ |
79 void start(); | 90 void start(); |
80 | 91 |
81 /** | 92 /** |
82 * Cancel the request in progress. | 93 * Cancel the request in progress. |
83 */ | 94 */ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 */ | 134 */ |
124 String getHeader(String name); | 135 String getHeader(String name); |
125 | 136 |
126 | 137 |
127 /** | 138 /** |
128 * Returns the exception that occurred while executing the request of null | 139 * Returns the exception that occurred while executing the request of null |
129 * if the request was successful. | 140 * if the request was successful. |
130 */ | 141 */ |
131 IOException getException(); | 142 IOException getException(); |
132 } | 143 } |
OLD | NEW |