Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8221641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:59:51+00:00 2026-06-07T13:59:51+00:00

Lets say I’m talking HTTP to a web server, and I will Accept html

  • 0

Lets say I’m talking HTTP to a web server, and I will Accept html or text, but prefer html. In other words, the header should say (I think!)

Accept: text/html, text/*

I’m using Java, so I have a URLConnection. Should I use:

myUrlConnction.setRequestProperty("Accept", "text/html");
myUrlConnction.addRequestProperty("Accept", "text/*");

or

myUrlConnction.setRequestProperty("Accept", "text/html, text/*");

or are they equivalent???

In general, most of the third party code I see doesn’t seem to worry much about ordering or multiple values of these headers, so I’m wondering how it ends up working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:59:54+00:00Added an answer on June 7, 2026 at 1:59 pm

    The first code snippet would result in two accept-headers while the second code snippet would give one accept-header with two selectors.

    They are in fact equivalent.

    The spec also states that the more specific media range have precedence, so both would yield your expected behavior.

    If you must specify several media ranges, and they are equally specific, you could add the q-parameter.

    Source: http 1.1 spec ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html ) :

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say that I have this code $(document).ready(function() { $(#changeText).click(function() { $(#textBox).html(My<br><br><br>text<br><br><br>is<br><br><br>changed!); }); });
Lets say I have several web sites on my web server, all as applications
Lets say I am currently at: http://example.com/folder/page.html Is it possible to create a relative
Lets say that i have 2 pages: index.php and service.php index.php sends an http-post
Lets say that I have gps coordinates for 1000 stores and a short text
Lets say I have a file with a .quote extension. I'd like the web
lets say i have a list of urls such as http://stackexchange.com https://stackoverflow.com/users/login http://careers.stackoverflow.com http://chat.stackoverflow.com
Lets say I have an asp.net label that has the value: Label1.Text = Hello
Lets say i got this div <div> Convert This into a vertical Text </div>
Lets say we have a table here, populated with the following data: acc_id1 acc_id2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.