harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "李竞沁" <littlee1...@gmail.com>
Subject Re: [classlib] [luni] HttpURLConnection does not have the "Accept" header (HARMONY-6036)
Date Mon, 08 Dec 2008 15:06:46 GMT
Hi Kevin,
The spec of Http said that "all headers except Host are optional.". And I
have investigated in the java api spec. No information about what headers
should be sent by the HttpURLConnection. It maybe a different behavior
between RI and harmony.
By the way, user can use setRequestProperty(key, value) method to set the
header field which he want to send.

On Mon, Dec 8, 2008 at 9:03 PM, Kevin Zhou <zhoukevin83@gmail.com> wrote:

> The Accept request-header field can be used to specify certain media types
> which are acceptable for the response.
> The Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 is
> acquired
> when conducting HeaderTest on RI.
> It can be interpreted as: "I prefer any media type, but send me if it is
> the
> best available after an 80% mark-down in quality".
> This is a multi-part message in MIME format.
>
> I find that RI has such a support, but we doesn't.
> Is it necessary to follow RI's behaviors on this?
>
>
> I think our code does not have such a line.
>
> On Mon, Dec 8, 2008 at 8:04 PM, Tim Ellison <t.p.ellison@gmail.com> wrote:
>
> > Kevin Zhou commented on HARMONY-6036:
> > > I investigated this problem and found that "Accept" property should
> > > be added in
> > >
> >
> org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.createRequest()
> > > method.
> > >
> > > From HTTP/1.1 specification,
> > >> "If no Accept header field is present, then it is assumed that
> > >> the client accepts all media types".
> > >
> > > if (reqHeader.get("Accept") == null) { //$NON-NLS-1$
> > > output.append("Accept: "text/html, image/gif, image/jpeg, *; "q=.2,
> > > */*; q=.2\r\n"); //$NON-NLS-1$ }>
> >
> > Kevin, can you help me to understand why we would express this set of
> > preferences in the Accept header for "/"?
> >
> > Its unclear to me why, by default, we would have that line?
> > (I understand what it does, just not which problem it solves.)
> >
> > Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> >
> > Thanks,
> > Tim
> >
>



-- 
Yours sincerely,
Charles Lee

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message