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 6902289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:46:47+00:00 2026-05-27T07:46:47+00:00

experts I am trying to implement a downloader which handles HTTP protocol, I am

  • 0

experts

I am trying to implement a downloader which handles HTTP protocol, I am able to send HTTP request using the following code:

StringBuilder request = new StringBuffer().append("GET ").append(uri.getPath());
if(uri.getQuery() != null)
    request.append('?').append(uri.getQuery());
request.append(" HTTP/1.1\nHost: ").append(uri.getHost()).append("\nAccept: */*\n\n");

// send the request
outputStream.write(request.toString().getBytes("utf-8"));
outputStream.flush();

On receiving the response, I will need to save the body of the response to disk, and the job is done.

My question is: are there any HTTP headers that I can set for the request which will cause the server to send the response without HTTP headers(only the body)?

The reason why I am asking this question is that if that is possible, I don’t need to skip the HTTP headers manually when reading the response, I can directly start reading raw bytes from the input stream. all I want is the body of the response, the HTTP headers don’t matter much in this case.

  • 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-05-27T07:46:48+00:00Added an answer on May 27, 2026 at 7:46 am

    No, you will always get the header back. And you will have to parse it since the resource you are trying to retrieve might come in different encodings and/or in multiple parts.

    On the other hand, this has been done for you already by tools like wget(1). You can either just use them, or look into the source to figure out what you need to do programmatically.

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

Sidebar

Related Questions

Im trying to implement an asp.net textbox using the jQuery UI Autocomplete widget http://jqueryui.com/demos/autocomplete/#remote
Apologies if the question sounds silly, I was following experts in SO and trying
I am using unity as my IoC container. I am trying to implement a
I'm trying to get a line of code in my ASP.net application (using Visual
I am using Ruby on Rails 3.0.7 and I am trying to implement an
I'm trying to implement some jQuery to scroll to a link which has a
I am trying to implement a custom SecurityToken and SecurityTokenHandler for a STS using
This is a simple htaccess question for experts but I have been trying to
Can any trig or GPS experts help me out here? I'm trying to create
i'm trying to do the following hope there's a reg_ex expert around to shed

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.