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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:58:54+00:00 2026-05-10T21:58:54+00:00

I need to create a request for a web page delivered to our web

  • 0

I need to create a request for a web page delivered to our web sites, but I need to be able to set the host header information too. I have tried this using HttpWebRequest, but the Header information is read only (Or at least the Host part of it is). I need to do this because we want to perform the initial request for a page before the user can. We have 10 web server which are load balanced, so we need to request the file from each of the web servers.

I have tried the following:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create('http://192.168.1.5/filename.htm'); request.Headers.Set('Host', 'www.mywebsite.com'); WebResponse response = request.GetResponse(); 

Obviously this does not work, as I can’t update the header, and I don’t know if this is indeed the right way to do it.

  • 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. 2026-05-10T21:58:54+00:00Added an answer on May 10, 2026 at 9:58 pm

    I have managed to find out a more long winded route by using sockets. I found the answer in the MSDN page for IPEndPoint:

    string getString = 'GET /path/mypage.htm HTTP/1.1\r\nHost: www.mysite.mobi\r\nConnection: Close\r\n\r\n'; Encoding ASCII = Encoding.ASCII; Byte[] byteGetString = ASCII.GetBytes(getString); Byte[] receiveByte = new Byte[256]; Socket socket = null; String strPage = null; try {     IPEndPoint ip = new IPEndPoint(IPAddress.Parse('10.23.1.93'), 80);     socket = new Socket(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);     socket.Connect(ip); } catch (SocketException ex) {     Console.WriteLine('Source:' + ex.Source);     Console.WriteLine('Message:' + ex.Message); } socket.Send(byteGetString, byteGetString.Length, 0); Int32 bytes = socket.Receive(receiveByte, receiveByte.Length, 0); strPage = strPage + ASCII.GetString(receiveByte, 0, bytes);  while (bytes > 0) {     bytes = socket.Receive(receiveByte, receiveByte.Length, 0);     strPage = strPage + ASCII.GetString(receiveByte, 0, bytes); } socket.Close(); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create an ASP page (classic, not ASP.NET) which runs remote shell
I need to create a 2D int array of size 800x800. But doing so
I need to call a web page that has javascript. At the bottom of
I got a code for connecting the web page but it shows always Connection
I've next problem: I need create unique user key based on user's information what
I am building a web application and I need to create a feedback form
This is going to sound like an odd request, but... I have a web
I need to create a historical timeline starting from 1600's to the present day.
I need to create an XML schema that looks something like this: <xs:element name=wrapperElement>
I need to create a linked server to a DB2 database on a mainframe.

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.