Skip to content
Permalink
Browse files
8272334: com.sun.net.httpserver.HttpExchange: Improve API doc of getR…
…equestHeaders

Reviewed-by: dfuchs, michaelm, chegar
  • Loading branch information
FrauBoes committed Aug 19, 2021
1 parent 6d3d479 commit 1c80f078f61a53ee80640e76a9af86f9b16a0618
Showing with 24 additions and 22 deletions.
  1. +24 −22 src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.URI;
import java.util.Map;

/**
* This class encapsulates a HTTP request received and a
@@ -79,51 +78,54 @@ protected HttpExchange() {
}

/**
* Returns an immutable {@link Map} containing the HTTP headers that were
* included with this request. The keys in this {@code Map} will be the header
* names, while the values will be a {@link java.util.List} of
* Returns an immutable {@link Headers} containing the HTTP headers that
* were included with this request.
*
* <p> The keys in this {@code Headers} are the header names, while the
* values are a {@link java.util.List} of
* {@linkplain java.lang.String Strings} containing each value that was
* included (either for a header that was listed several times, or one that
* accepts a comma-delimited list of values on a single line). In either of
* these cases, the values for the header name will be presented in the
* order that they were included in the request.
* included in the request, in the order they were included. Header fields
* appearing multiple times are represented as multiple string values.
*
* <p> The keys in {@code Map} are case-insensitive.
* <p> The keys in {@code Headers} are case-insensitive.
*
* @return a read-only {@code Map} which can be used to access request headers
* @return a read-only {@code Headers} which can be used to access request
* headers.
*/
public abstract Headers getRequestHeaders();

/**
* Returns a mutable {@link Map} into which the HTTP response headers can be
* stored and which will be transmitted as part of this response. The keys in
* the {@code Map} will be the header names, while the values must be a
* {@link java.util.List} of {@linkplain java.lang.String Strings} containing
* each value that should be included multiple times (in the order that they
* should be included).
* Returns a mutable {@link Headers} into which the HTTP response headers
* can be stored and which will be transmitted as part of this response.
*
* <p> The keys in the {@code Headers} are the header names, while the
* values must be a {@link java.util.List} of {@linkplain java.lang.String Strings}
* containing each value that should be included multiple times (in the
* order that they should be included).
*
* <p> The keys in {@code Map} are case-insensitive.
* <p> The keys in {@code Headers} are case-insensitive.
*
* @return a writable {@code Map} which can be used to set response headers.
* @return a writable {@code Headers} which can be used to set response
* headers.
*/
public abstract Headers getResponseHeaders();

/**
* Get the request {@link URI}.
* Returns the request {@link URI}.
*
* @return the request {@code URI}
*/
public abstract URI getRequestURI();

/**
* Get the request method.
* Returns the request method.
*
* @return the request method
*/
public abstract String getRequestMethod();

/**
* Get the {@link HttpContext} for this exchange.
* Returns the {@link HttpContext} for this exchange.
*
* @return the {@code HttpContext}
*/

1 comment on commit 1c80f07

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 1c80f07 Aug 19, 2021

Please sign in to comment.