197 * HttpClient.Builder#executor(Executor) executor} has not been set for an |
197 * HttpClient.Builder#executor(Executor) executor} has not been set for an |
198 * {@code HttpClient}, and a security manager has been installed, then the |
198 * {@code HttpClient}, and a security manager has been installed, then the |
199 * default executor will execute asynchronous and dependent tasks in a context |
199 * default executor will execute asynchronous and dependent tasks in a context |
200 * that is granted no permissions. Custom {@linkplain HttpRequest.BodyPublisher |
200 * that is granted no permissions. Custom {@linkplain HttpRequest.BodyPublisher |
201 * request body publishers}, {@linkplain HttpResponse.BodyHandler response body |
201 * request body publishers}, {@linkplain HttpResponse.BodyHandler response body |
202 * handlers}, and {@linkplain HttpResponse.BodySubscriber response body |
202 * handlers}, {@linkplain HttpResponse.BodySubscriber response body subscribers}, |
203 * subscribers}, if executing operations that require privileges, should do so |
203 * and {@linkplain WebSocket.Listener WebSocket Listeners}, if executing |
204 * within an appropriate {@linkplain AccessController#doPrivileged(PrivilegedAction) |
204 * operations that require privileges, should do so within an appropriate |
205 * privileged context}. |
205 * {@linkplain AccessController#doPrivileged(PrivilegedAction) privileged context}. |
206 * |
206 * |
207 * <p> <b>Examples</b> |
207 * <p> <b>Examples</b> |
208 * <pre>{@code |
208 * <pre>{@code |
209 * HttpClient client = HttpClient |
209 * HttpClient client = HttpClient |
210 * .newBuilder() |
210 * .newBuilder() |
435 * given values. |
435 * given values. |
436 * |
436 * |
437 * @apiNote The {@linkplain #noBody() noBody} request body publisher can |
437 * @apiNote The {@linkplain #noBody() noBody} request body publisher can |
438 * be used where no request body is required or appropriate. |
438 * be used where no request body is required or appropriate. |
439 * |
439 * |
|
440 * @param method the method to use |
440 * @param bodyPublisher the body publisher |
441 * @param bodyPublisher the body publisher |
441 * @param method the method to use |
|
442 * @return a {@code HttpRequest} |
442 * @return a {@code HttpRequest} |
443 * @throws IllegalArgumentException if the method is unrecognised |
443 * @throws IllegalArgumentException if the method is unrecognised |
444 */ |
444 */ |
445 public abstract Builder method(String method, BodyPublisher bodyPublisher); |
445 public abstract Builder method(String method, BodyPublisher bodyPublisher); |
446 |
446 |