473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

request.Headers.Clear() doesnt work correctly?

Hi

I have a problem with http headers.
Iam creating:
private HttpWebRequest request = null;

and:

request = (HttpWebRequest)WebRequest.Create(server);

request.Headers.Clear();

request.Headers.Add("GET", serverPath + " HTTP/1.0");

request.Headers.Add("Icy-MetaData", "1");

request.UserAgent = "WinampMPEG/5.09";

When i try to connect to the 'server' my port sniffer show me in request
unwanted header:

GET / HTTP/1.1 <--- where does is come from?????

GET: /stream/1077 HTTP/1.0

Icy-MetaData: 1

User-Agent: WinampMPEG/5.09

Host: nyc.etn.fm

Connection: Keep-Alive

ICY 404 Resource Not Found

icy-notice1:SHOUTcast Distributed Network Audio Server/posix v1.8.1<BR>

icy-notice2:The resource requested was not found<BR>

Server rejects request because cant see stream in path "/". But i have
specified different path?!?!?!

Can someone help me and tell where does the unwanted header come from?

I Use VS2005 beta.

PK


Nov 17 '05 #1
5 5098
PK,

That is not considered part of the HTTP Header. GET is the method, /
is the resource, HTTP/1.1 is the protocol and its version. You can
certainly change these, take a look at the API doc.

HTH,
Alex

Nov 17 '05 #2
That is not considered part of the HTTP Header. GET is the method, /
is the resource, HTTP/1.1 is the protocol and its version. You can
certainly change these, take a look at the API doc.

HTH,
Alex


What is not considered? I added header. When i use request.headers.set
method for GET header, same thing happens.
PK
Nov 17 '05 #3
Sorry for the confusion, this line "GET / HTTP/1.1" is part of the
header, but not the meta info like the others...
From the API doc, use .Method to change the method, use

..ProtocolVersion to change the protocol version. As simple as that.

Alex

Nov 17 '05 #4
From the API doc, use .Method to change the method, use

.ProtocolVersion to change the protocol version. As simple as that.

Alex


I only wanna change '/' to my '/path'. Dont wanna change the method couse i
dont exactly know how other method should look like.
Good news is i changed the version - thx for that. If you could only tell me
how to change the path it would be very nice for me.

Nov 17 '05 #5
Does anyone know how to change the path without changing the method?
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sanjay Dahiya | last post by:
I tried POSTing from XMLHttpRequest, i can get the XML right on server but responseXML from server is coming null. I can see the XML right in responseText. but responseXML is null. responseText to...
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
1
by: Chad A. Beckner | last post by:
Hi, I am trying to figure out how to add a header to an incoming request in ASP.NET. This is needed because I need to set some header information which ASP (non-DOTNET) uses to process...
1
by: Piotrekk | last post by:
Hi I have the following code: request = (HttpWebRequest)WebRequest.Create(FullPath); request.Headers.Clear(); request.ProtocolVersion = HttpVersion.Version11; response =...
4
by: yoram.ayalon | last post by:
Hi, I need to create a multipart request to UPS manifest upload electronic service. UPS wants the request to consist of a series of headers and bodies, and its not clear how can I use the...
0
by: paulshannon | last post by:
Hi All, We've been using Request.IsSecureConnection for some time to drop in and out of SSL for various sections of our web application. We have recently change server architecture though as we...
5
by: dabei | last post by:
Hi, I am trying to use AS3 to make a URL request with authorization header. Using the code below: var request:URLRequest = new URLRequest ( 'http://myserviceURL' ); var...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.