OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 android.support.annotation.IntDef; | 7 import android.support.annotation.IntDef; |
8 | 8 |
9 import java.lang.annotation.Retention; | 9 import java.lang.annotation.Retention; |
10 import java.lang.annotation.RetentionPolicy; | 10 import java.lang.annotation.RetentionPolicy; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 /** | 83 /** |
84 * Sets the HTTP method for the request. Returns builder to facilitate c
haining. | 84 * Sets the HTTP method for the request. Returns builder to facilitate c
haining. |
85 * | 85 * |
86 * @param method the method to use for request. Default is 'POST' | 86 * @param method the method to use for request. Default is 'POST' |
87 * @return the builder to facilitate chaining | 87 * @return the builder to facilitate chaining |
88 */ | 88 */ |
89 public Builder setHttpMethod(String method) { | 89 public Builder setHttpMethod(String method) { |
90 if (method == null) { | 90 if (method == null) { |
91 throw new NullPointerException("Invalid method name."); | 91 throw new NullPointerException("Method is required."); |
92 } | 92 } |
93 mHttpMethod = method; | 93 mHttpMethod = method; |
94 return this; | 94 return this; |
95 } | 95 } |
96 | 96 |
97 /** | 97 /** |
98 * Adds a request header. Returns builder to facilitate chaining. | 98 * Adds a request header. Returns builder to facilitate chaining. |
99 * | 99 * |
100 * @param header the header name | 100 * @param header the header name |
101 * @param value the header value | 101 * @param value the header value |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 /** | 399 /** |
400 * Returns {@code true} if the stream was successfully started and is now | 400 * Returns {@code true} if the stream was successfully started and is now |
401 * done (succeeded, canceled, or failed). | 401 * done (succeeded, canceled, or failed). |
402 * | 402 * |
403 * @return {@code true} if the stream was successfully started and is now | 403 * @return {@code true} if the stream was successfully started and is now |
404 * done (completed, canceled, or failed), otherwise returns {@code f
alse} | 404 * done (completed, canceled, or failed), otherwise returns {@code f
alse} |
405 * to indicate stream is not yet started or is in progress. | 405 * to indicate stream is not yet started or is in progress. |
406 */ | 406 */ |
407 public abstract boolean isDone(); | 407 public abstract boolean isDone(); |
408 } | 408 } |
OLD | NEW |