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

  • Home
  • SEARCH
  • 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 8701385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:23:12+00:00 2026-06-13T02:23:12+00:00

I am using .Net 4 and VS express 2010. I could make my post

  • 0

I am using .Net 4 and VS express 2010.

I could make my post request but I cant set some of the headers.
Below code work fines

WebRequest Request = Request.Create("http://example.com") as HttpWebRequest;
Request.Method = "POST";
Request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
Request.Headers.Set("Accept-Encoding", "gzip,  deflate");

The problems is that I cant set other headers like “Accept”,”UserAgent”,”Referer”,”Connection”

I had tried the following ways but fail

Request.Accept = "*/*";
Request.Headers.Set("Accept", "*/*");

For the first line, the Accept property doesn’t exist
while for the second line, the header need to be edited with a proper method or property.

I am a rookie and I had searched on google and stackoverflow.
If you don’t know how to solve it, pointing out any direction in fixing this like reinstalling something would be really appreciated.

  • 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-13T02:23:14+00:00Added an answer on June 13, 2026 at 2:23 am

    Accept doesn’t exist as a property on WebRequest, but it does exist on HttpWebRequest.

    HttpWebRequest request = (HttpWebRequest) Request.Create("http://example.com");
    request.Accept = "*/*";
    

    Even though you were previously using as HttpWebRequest (and I’d strongly suggest preferring casting instead), your variable was declared to be of type WebRequest, which is why it wouldn’t compile.

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

Sidebar

Related Questions

I'm using Visual Web Developer 2010 Express on my laptop to run some ASP.Net
I have created an application in VB.NET (using Microsoft Visual Basic 2010 Express) with
I am using VS express 2010 and .Net 4.0. I bind a DataGridView to
I am using VB.NET 2010 (Visual Basic 2010 Express) on a WPF-based project. I
I'm working on a personal project in Visual Studio 2010 Express edition, using ASP.NET
I'm building an ASP.net application using Visual Studio Web Developer 2010 Express and have
I created a new ASP.NET website using Visual Web Developer 2008 Express edition and
Ok, I'm using SQL Server Express 2008 and .Net 3.5 (c#) I have a
using .NET 3.5. I have a function I want to make multithreaded calls to.
I have developed a Windows Form Application in Visual Studio 2010, i.e., using .Net

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.